【问题标题】:Custom MessageDialougeBox in Windows Store AppsWindows 应用商店应用程序中的自定义 MessageDialogeBox
【发布时间】:2013-08-14 06:06:33
【问题描述】:

我正在开发一个 Windows 应用商店应用程序,我必须在其中实现一个 MessageDialougeBox,它有更多的控件,然后只有一些消息字符串和按钮。我检查了 MessageDialougeBox 类,但它没有显示任何内容模板属性首先我虽然这是不可能的,但是当我看到 Windows 8 的 Skype 应用程序时,他们已经做到了。所以我怎么能做到这一点.. 任何帮助表示赞赏。我想要这样的东西

我知道有一个弹出控件。其实重点是,我必须在这个控件上付出额外的努力,让它看起来像 MessageDialougebox..有什么方法可以更改或编辑 MessageDialougebox 的内容..

【问题讨论】:

    标签: c# xaml windows-8 windows-store-apps messagebox


    【解决方案1】:

    Callisto toolkit 提供自定义消息对话框。可以托管任何 UI 元素。示例如下。

    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;
    }
    

    输出

    【讨论】:

    • 我不知道我在做什么..我必须先检查这个工具包中的控件..顺便说一句谢谢..
    【解决方案2】:

    您的要求是构建弹出窗口而不是消息框。 See this sample

    【讨论】:

    • 谢谢 binu,但我知道有一个弹出控件。实际上,关键是我必须在这个控件上付出额外的努力,让它看起来像 messageDialougebox。有什么办法可以改变或编辑 messageDialogebox 内容..
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-22
    • 2013-11-14
    • 1970-01-01
    • 1970-01-01
    • 2015-09-05
    相关资源
    最近更新 更多