简体   繁体   中英

Custom MessageDialougeBox in Windows Store Apps

I am Working On a Windows Store App in which i have to implement a MessageDialougeBox that has more controls then just having some message strings and Buttons.I have checked the MessageDialougeBox class but it is not showing any content template property first i though it is not possible but when i saw the Skype Application for windows 8 they had done that.so how i could achieve that.. any help is appreciated. i want something like this

I know there is a popup control. Actually the point is, I have to apply extra effort on this control to make it look like MessageDialougebox..is there any way that i can change or edit the MessageDialougebox content..

在此处输入图片说明

Your requirement is to build Popup window not message box. See this sample

Callisto toolkit provides custom message dialog. Which can host any UI elements. The sample is given below.

XAML

<Page
................
xmlns:callisto="using:Callisto.Controls">
    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <callisto:CustomDialog x:Name="LoginDialog" 
                                Title="Bacon Terms and Conditions" 
                                Background="Teal" BackButtonVisibility="Visible">
            <StackPanel>
                <TextBlock Margin="0,0,0,8" FontSize="14.6667" FontWeight="SemiLight" TextWrapping="Wrap">
                    Bacon sausage frankfurter tenderloin turkey salami andouille bresaola. Venison salami prosciutto, pork belly turducken tri-tip spare ribs chicken strip steak fatback shankle tongue boudin andouille. Meatloaf salami pork ground round turkey jerky meatball ball tip, filet mignon fatback flank prosciutto shank. Turkey boudin ham hock, filet mignon tri-tip bresaola tongue venison spare ribs meatloaf flank beef pancetta. Leberkas turducken flank ground round biltong chuck bacon kielbasa. Beef pastrami meatball, short loin venison swine pork loin shank meatloaf spare ribs.
                </TextBlock>
                <CheckBox Margin="0,0,0,8" Foreground="White" Content="I agree to the Terms and Conditions of Bacon" />
                <TextBlock Margin="0,0,0,8" FontSize="14.6667" FontWeight="SemiLight" Text="Enter your name for acceptance" />
                <callisto:WatermarkTextBox HorizontalAlignment="Left" Watermark="Type your name" Width="400" Height="35" />
                <StackPanel Margin="0,20,0,0" HorizontalAlignment="Right" Orientation="Horizontal">
                    <Button Content="OK" Width="90" Margin="0,0,20,0" />
                    <Button Content="Cancel" Width="90" />
                </StackPanel>
            </StackPanel>
        </callisto:CustomDialog>
    </Grid>
</Page>

CS

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    LoginDialog.IsOpen = true;
}

The output

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM