1
我有一個窗口,並且想要設置圖片而不是標題文本,但它只顯示圖像名稱空間的字符串。如何使用MashAPPs.Metro在XAML中的窗口標題中設置圖像
代碼:
<Controls:MetroWindow x:Class="AdminControlCenter.View.MainView"
...
Title="{Binding ImageViewModel.TitleBarImage}" Height="400" Width="600"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance vm:MainViewModel}" Icon="{Binding ImageViewModel.Icon}">
圖片:
圖標顯示正確並且圖像被保存爲一個的BitmapImage。
如何在窗口標題中設置圖像而不是普通文本?
取而代之的是,爲什麼不要將圖像存儲在應用程序根文件夾中,並指定圖像的路徑。 – VVN
我使用MVVM模式製作程序 – SeeuD1
窗口圖標對於所有窗口都是通用的嗎?那麼,爲什麼要使用MVVM模式?只需指定圖標的路徑即可。 – VVN