1

I'm working on a Windows 8 app (Windows Store App) and i need to integrate a customisable calendar control. I need to use free libraries so i'm pretty limited by that. I digged around the Calendar control of the WinRTXamlToolkit but I couldn't find out a way to expand its width to make it take its parent control's width.

I tried to do basic stuffs such as

<c:Calendar Style="{x:Null}" Width="1200"/>

or

<c:Calendar Width="{Binding ActualWidth, ElementName=MainGrid}"/>

None of those solutions worked...

Is there a way to do so ? Or is there another control that i should be aware of ?

Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233
dotixx
  • 1,490
  • 12
  • 23
  • Have you tried ``? The second won't work unless your MainGrid notifies `PropertyChanged` I don't believe. – Nate Diamond Oct 09 '14 at 23:34
  • @NateDiamond That was the first thing i tried and obviously it didn't work.. :/ – dotixx Oct 13 '14 at 08:14
  • You may need to create a custom style. The source is available on codeplex, so you can just copy it in and change it how you want. – Nate Diamond Oct 13 '14 at 18:14
  • @NateDiamond Okay, then i'll do that. That's pretty weird that the component doesn't allow to change its width by itself. Anyway, thanks :) – dotixx Oct 14 '14 at 07:12

1 Answers1

0

I had a similar issue and put the calendar control inside a viewbox element like this.

<Viewbox Width="200">
    <xamltk:Calendar IsTodayHighlighted="True" DisplayMode="Month"/>
</Viewbox>

A viewbox scales its single child element to the size of the viewbox. Don't forget to set xamltk namespace to WinRTXamlToolkit.Controls.