Posts

Validation By IDataErrorInfo in Wpf using MVVM

<Window x:Class="WpfPrismTutorial.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:WpfPrismTutorial"         mc:Ignorable="d"         prism:ViewModelLocator.AutoWireViewModel="True"         xmlns:prism="http://prismlibrary.com/"         xmlns:valid="clr-namespace:WpfPrismTutorial.Validations"         Title="MainWindow" Height="450" Width="800">     <Window.Resources>         <ControlTemplate x:Key=" errorTemplate ">             <StackPanel Orientation="Horizontal">             <AdornedElementPlaceholder x:Name

Validation By Annotation in Wpf using MVVM

View  <Window x:Class="WpfPrismTutorial.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:WpfPrismTutorial"         mc:Ignorable="d"         prism:ViewModelLocator.AutoWireViewModel="True"         xmlns:prism="http://prismlibrary.com/"         xmlns:valid="clr-namespace:WpfPrismTutorial.Validations"         Title="MainWindow" Height="450" Width="800">     <Window.Resources>         <ControlTemplate x:Key=" errorTemplate ">             <StackPanel Orientation="Horizontal">             <AdornedElementPlaceholder x:

Validation By Exception in Wpf using MVVM

Image
View <Window x:Class="WpfPrismTutorial.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:WpfPrismTutorial"         mc:Ignorable="d"         prism:ViewModelLocator.AutoWireViewModel="True"         xmlns:prism="http://prismlibrary.com/"         xmlns:valid="clr-namespace:WpfPrismTutorial.Validations"         Title="MainWindow" Height="450" Width="800">     <Window.Resources>         <ControlTemplate x:Key=" errorTemplate ">             <StackPanel Orientation="Horizontal">             <AdornedElementPlaceholder x:N

How to change background color of TabItems on mouse over?

<TabControl >             <TabControl.ItemContainerStyle>                 <Style TargetType="TabItem" BasedOn="{StaticResource {x:Type TabItem}}">                     <Setter Property="HeaderTemplate">                         <Setter.Value>                             <DataTemplate>                                 <StackPanel Orientation="Horizontal" Margin="5" >                                     <StackPanel.Style>                                         <Style TargetType="StackPanel">                                             <Setter Property="Background" Value="Red"/>                                             <Style.Triggers>                                                 <Trigger Property="IsMouseOver" Value="true">                                                     <Setter Property="

Easy way of navigate using Prism in WPF

Image
1. First.xaml <UserControl x:Class="PrismMain.Views.First"              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"              xmlns:local="clr-namespace:PrismMain.Views"              mc:Ignorable="d"              xmlns:prism="http://prismlibrary.com/"         prism:ViewModelLocator.AutoWireViewModel="True">     <StackPanel>           <Button Content="Navigate To Second" Margin="5"  Command="{Binding NavigateCommand}" Width="150"/>     </StackPanel> </UserControl> First.xaml.cs public partial class First: UserControl     {         pu