Thursday, March 30, 2017

wpf MahAppsMetro for modern ui design

wpf  MahAppsMetro for modern ui design
       Modern UI Icons for the Add, Save and Delete buttons.


Create the following User Interface.
Bonus (optional): Use MahAppsMetro for the Modern UI design.
Bonus (optional): Use Modern UI Icons for the Add, Save and Delete buttons. You need to add their Path with a Key name after the ResourceDictionary section as it is highlighted below:
<ResourceDictionary >
      <ResourceDictionary.MergedDictionaries>
        <!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
        <ResourceDictionary  Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
        <ResourceDictionary
       
      </ResourceDictionary.MergedDictionaries>

      <Path x:Key="Add"  Width="39.0251" Height="37.9537" Stretch="Fill" Fill="#FF000000"
            Data="F1 M 53.2929,21.2929L 54.7071,22.7071C ………..
Then in your code, you can bind to these controls as a static resource by using their key name.
    <Button  Margin="5" Content="{Binding Source={StaticResource Add}}" ></Button>

Tip (recommended): Use a MVVM pattern to connect the View to the ViewModel. 

Friday, March 24, 2017