windows 8.1 MessageDialog

來源:互聯網
上載者:User

標籤:des   style   class   blog   c   code   

 1     private Popup p; 2         private void Button_Click(object sender, RoutedEventArgs e) 3         { 4             p=new Popup(); 5             DengluDemo dl=new DengluDemo(); 6             dl.Width = 1366; 7             dl.Height = 260; 8             dl.Margin = new Thickness(0, 200, 0, 0); 9             //if (p != null || p.IsOpen == true)10             //{11             //    return;12             //}13             MessageDialog md = new MessageDialog("是否退出登陸");14             md.Commands.Add(new UICommand("確定", (a) =>15             {16                 17             }, 0));18             md.Commands.Add(new UICommand("取消", (a) =>19             {20 21             }, 1));22             md.DefaultCommandIndex = 0;23             md.CancelCommandIndex = 1;24             var cmd = md.ShowAsync();25             dl.eh = (a, b) =>26             {27                 p.Child = dl;28                 p.IsOpen = true;29             };30             p.Child = dl;31             p.IsOpen = true;32 33         }34     }
 1 <UserControl 2     x:Class="vs2013win8._1.DengluDemo" 3     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 4     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 5     xmlns:local="using:vs2013win8._1" 6     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 7     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 8     mc:Ignorable="d" 9     d:DesignHeight="260"10     d:DesignWidth="1360">11 12     <Grid>13         <Grid.Background>14             <SolidColorBrush Color="Black" Opacity="0.7"></SolidColorBrush>15         </Grid.Background>16         <StackPanel Background="LightSeaGreen" Orientation="Vertical" >17            18             <StackPanel Orientation="Horizontal" Margin="428,40,0,0">19                 <TextBlock Text="使用者名稱:" FontSize="25" Width="80"></TextBlock>20                 <TextBox x:Name="txt_Name" Width="273" Margin="20,0,0,0"></TextBox>21             </StackPanel>22 23             <StackPanel Orientation="Horizontal" Margin="428,40,0,0">24                 <TextBlock Text="密   碼:" FontSize="25" Width="80"></TextBlock>25                 <PasswordBox x:Name="txt_Password" Width="273" Margin="20,0,0,0"></PasswordBox>26             </StackPanel>27 28             <StackPanel Orientation="Horizontal" Margin="428,30,0,0">29                 <HyperlinkButton Tapped="Button_Tapped_3" FontSize="18" Foreground="White">還沒有帳號 點擊去註冊</HyperlinkButton>30                 <Button Tapped="Button_Tapped_1" Content="登入" FontSize="20" Foreground="White" Background="LightSeaGreen"  Width="150"  Height="49" Margin="180,0,0,0"/>31                 <Button Tapped="Button_Tapped_2" Content="取消" FontSize="20" Foreground="White" Background="LightSeaGreen"  Width="153"  Height="49" Margin="20,0,0,0"/>32             </StackPanel>33         </StackPanel>34     </Grid>35 </UserControl>
1   public EventHandler eh;2         private void Button_Tapped_1(object sender, TappedRoutedEventArgs e)3         {4             if (eh != null)5             {6                 eh(this,null);7             }8         }

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.