Hi,
I would like to override selected border style on the month view . How i can do it.
Kindly see sample screen shot and xaml file that I have used.
Yes it worked . Thank for your help
Hello cchaisanit,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.
I’ve been looking into your requirement and actually the visual you are trying to style is the AppointmentPresenter (that inherits from the ActivityPresenter) and not the XamMonthView itself. Inside the ActivityPresenter’s ControlTemplate there is a Path object, named BorderPath that is actually responsible for the border you are have shown in the attached screenshot. Usually all that info can be acquired using an UI viewer (like XamlSpy, Snoop, etc.) This BorderPath’s Stroke and StrokeThickness properties are bound to a couple of read-only properties (ComputedBorderBrush and ComputedBorderStrokeThickness):
…<Path x:Name="BorderPath"
Fill="{TemplateBinding ComputedBackground}"
Stroke ="{TemplateBinding ComputedBorderBrush}"
StrokeThickness ="{TemplateBinding ComputedBorderStrokeThickness}"
igPrim:XamlHelper.SnapsToDevicePixels="True"/>…
which would actually leave only retemplating the presenters as an option for modifying the appearance. I have extracted the necessary resource from the DefaultStyles folder (default install path: C:\Program Files (x86)\Infragistics\NetAdvantage 2012.2\WPF\DefaultStyles\Schedule\ generic.shared.xaml ) and have created a resource dictionary (Dictionary1.xaml) that you can directly put in your project and use to style all AppointmentPresenters. In it I have changed:
<Path x:Name="BorderPath"
Stroke="Green"
StrokeThickness="1"
igPrim:XamlHelper.SnapsToDevicePixels="True"/>
and added a VisualState that would correspond the selection of an appointment:
<VisualState Name="Selected">
<Storyboard Storyboard.TargetName="BorderPath" Storyboard.TargetProperty="StrokeThickness">
<ObjectAnimationUsingKeyFrames>
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<sys:Double>10</sys:Double>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
Please let me know, if I can be of any further assistance on the matter.