Posts

Showing posts from May, 2020

How to apply theme and color in wpf Metro window application

Image
In this example i am using Prism,unity and MahApps make sure you are also using same otherwise you will not get PrismApplication,BindableBase and MetroWindow .   MainWindow.xaml  <metro:MetroWindow x:Class="WpfApplication.Views.MainWindow"              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"              xmlns:local="clr-namespace:WpfApplication"              mc:Ignorable="d"              xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"              xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"              Title="Welcome To Metro ui with Prism Unity">      <

Print preview with Print in wpf using MVVM, Prism

  MainWindow.xaml  <Window x:Class="WpfDemo.Views.MainWindow"              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"              xmlns:local="clr-namespace:WpfDemo"              mc:Ignorable="d" Title="MainWindow">      <StackPanel Orientation="Vertical" HorizontalAlignment="Center">          <TextBlock Text="This is Print Preview demo"/>          <Button Content="Open file dialog" Command="{Binding ClickCommand}"  Margin="10" Width="100"/>        </StackPanel>  </Window>   MainWindow.xaml.cs   public partial class MainWindow : Window