I have created 2 dependency property IsMonthYear and DateFormat.I have written two classes for just two properties which i found is not a efficient solution.Is there any better approach to display from and to datepicker in MM/yyyy format and also open a calender of month and year only.
<DatePicker Grid.Column="0"
local:DatePickerCalendar.IsMonthYear="True"
local:DatePickerDateFormat.DateFormat="MM/yyyy"
Name="FromDate_Picker"
Width="Auto"
Margin="38,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
KeyboardNavigation.TabIndex="1"
Padding="0"
Text="MM/yyyy"
SelectedDate="{Binding RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type Window}},
Path=DataContext.OutageStartDate,
StringFormat='MM yyyy',
Mode=TwoWay}"
Style="{DynamicResource supplyDisruptiondDatePicker}"></DatePicker>