Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 如何自定义ModernWindow以具有固定的ModernFrame?_Wpf_Xaml_Mvvm_Modern Ui - Fatal编程技术网

Wpf 如何自定义ModernWindow以具有固定的ModernFrame?

Wpf 如何自定义ModernWindow以具有固定的ModernFrame?,wpf,xaml,mvvm,modern-ui,Wpf,Xaml,Mvvm,Modern Ui,我使用的是Modern UI,我有一个简单的ModernWindow,默认内容是UserControl,另外三个UserControls作为标题链接 我想做的是在窗口底部有一个固定的框架(绑定到类型为Exception的依赖属性),这样当用户浏览这些链接时,这个异常框架可以保持静止。问题是当我这样做时,它没有显示任何内容: <mui:ModernWindow x:Class="SBSA.MainWindow" xmlns="http://schemas.microsoft.

我使用的是Modern UI,我有一个简单的ModernWindow,默认内容是
UserControl
,另外三个
UserControls
作为
标题链接

我想做的是在窗口底部有一个固定的框架(绑定到类型为
Exception
的依赖属性),这样当用户浏览这些链接时,这个异常框架可以保持静止。问题是当我这样做时,它没有显示任何内容:

<mui:ModernWindow x:Class="SBSA.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mui="http://firstfloorsoftware.com/ModernUI"
        ContentSource="/DefaultPageView.xaml"
        Height="650" Width="925">

        <DockPanel>
            <mui:ModernFrame Content="{Binding Error}" DockPanel.Dock="Bottom"/>

            <mui:ModernWindow.TitleLinks>
                <mui:Link DisplayName="Page1" Source="/Page1View.xaml" />
                <mui:Link DisplayName="Page2" Source="/Page2View.xaml" />
                <mui:Link DisplayName="Page3" Source="/Page3View.xaml" />
            </mui:ModernWindow.TitleLinks>
        </DockPanel>

</mui:ModernWindow>

我知道我可以在每个UC中实现它,但我想知道是否有更好的方法来定制ModernWindow

编辑 这将起作用,但它没有显示所需错误消息的固定面板:

<mui:ModernWindow x:Class="SBSA.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mui="http://firstfloorsoftware.com/ModernUI"
        ContentSource="/DefaultPageView.xaml"
        Height="650" Width="925">

        <mui:ModernWindow.TitleLinks>
                <mui:Link DisplayName="Page1" Source="/Page1View.xaml" />
                <mui:Link DisplayName="Page2" Source="/Page2View.xaml" />
                <mui:Link DisplayName="Page3" Source="/Page3View.xaml" />
        </mui:ModernWindow.TitleLinks>

</mui:ModernWindow>


如何设置此窗口的DataContext?
Error
属性是字符串还是UserControl实例本身?需要更多的信息来帮助您。实际上,它是ModernWindow视图模型中的DependencyProperty(类型为
异常
)。它的值通常在catch()语句中更改。问题是我无法自定义ModernWindow的内容以添加DockPanel。