Silverlight 4

Jun 15, 2010 at 2:47 AM

I am very interesting in this control but I'm not sure how/if I can get it working in a Silverlight 4 project. Please let me know since this looks far superior to anything else and I have an immediate need for this type of functionality.

Jun 15, 2010 at 10:21 AM

Sure you can include this in a Silverlight 4 project.You just download the project from Codeplex, include it in your project an on the Silverlight page where you want to place the Calendar control you drag and drop it from the ToolBox(it's a usercontrol).

Jun 16, 2010 at 10:21 PM

I have tried this but I'm still having problems.

A) I'm not sure exactly which control is the one I want. (I want the multi-select / half day calendar).

B) The one that I believe I want is ucCalendar(SLControlLibrary.Resources.Controls.Calendar) but as soon as I try and drop it onto my page in visual studio I just get a box, "Object reference not set to instance of an object." When I try and drag this control in Expression Blend whole page disappears and it shows an error "Error HRESULT E_FAIL has been returned from a call to a COM component."

Coordinator
Jun 16, 2010 at 11:08 PM

Adriana Cioica is correct about how to add the control.  I have been able to use this existing code and add it to a silverlight 4 application.  I have also updated the library a great deal since i last upload code onto this site.  Not sure if i want to release that piece of it because of maintanence and so forth.  I have very little time to play with the library anymore.

The calendar you are looking for is the ClassicCalendar with the options of DisplayMode="Select" and SelectionMode="Multiple".  You should be able to add a reference to your project of the "SLControlLibrary.Resources.Controls.Calendar.ClassicCalendar" and use the "ucCalendar" object on your page.  If the drag and drop does not work then you can add it manually by adding a reference to the assembly listed in your namespaces and create the object in xaml:

xmlns:SLCalendar="clr-namespace:SLControlLibrary.Resources.Controls.Calendar.ClassicCalendar;assembly=SLControlLibrary"

<SLCalendar:ucCalendar x:Name="ccDisplay"
                                       DateView="Decade"
                                       BorderBrush="Black"
                                       VerticalAlignment="Top"
                                       HorizontalAlignment="Center"
                                       DisplayMode="Selection"
                                       HeaderForeground="{Binding SelectedItem, ElementName=cbHeaderForeColor}"
                                       HeaderBackground="{Binding SelectedItem, ElementName=cbHeaderColor}"
                                       WeekHeaderForeground="{Binding SelectedItem, ElementName=cbWeekHeaderColor}"
                                       YearForeground="{Binding SelectedItem, ElementName=cbYearForeColor}"
                                       MonthForeground="{Binding SelectedItem, ElementName=cbMonthForeColor}"
                                       SelectedDatesChanged="ccDisplay_SelectedDatesChanged"/> 

Just as it is done in the demo project in the SelectionCalendar.xaml file.  To add the mult-select add another attribute to the ccDisplay SelectionMode="Multiple" and that should allow you to use the control.

Coordinator
Jun 16, 2010 at 11:09 PM

One more thing to note: I am not sure if it will work in Expressions blend.  I have done very little testing with expresions but i do not see why it would not because they are all templated controls.

Jun 16, 2010 at 11:16 PM

Thanks I will try that tonight... and yes at least the other controls are able to successfully drag and drop into expression blend.

Any chance I can convince you to send me the updated library:P

Jul 9, 2010 at 10:23 AM

Hello,

I have downloaded the calendar control and I am in the need of the same. One thing that I would like to ask is that when I click on "Click To Add Appointment" , a pop up is open where the description and other details can be filled up. But the start and end time text box remains empty. So is it possible that whenever the user click to open the pop up , the rectangle(or border) in which he clicks, the time slot for that particular slot get displays in the text box. If it is possible then how can I make that changes to fulfill the need.

Thanks

Developer
Aug 12, 2010 at 3:33 PM

I've added specific projects/solution for VS2010 .Net 4.0/SL 4.0. Use the "SLControlLibrary VS2010.sln" for the VS2010 which is defaulted to SL 4.0.

Nov 18, 2010 at 3:49 PM

Hi,

HI,

I have the same problem; I've added a reference to Disclaimer.Controls.ClassicCalendarExt.dll,  but if I add the component to my usercontrol I get an exception; running application raise exception.

My xaml code is

<UserControl xmlns:my="clr-namespace:Disclaimer.Controls.ClassicCalendarExt;assembly=Disclaimer.Controls.ClassicCalendarExt"  x:Class="TestCalendario.MainPage"            
    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"
    mc:Ignorable="d"
   
    d:DesignHeight="300" d:DesignWidth="400">
    <Grid x:Name="LayoutRoot" Background="White">
        <my:ucCalendar />
    </Grid>
</UserControl>

 

Thanks, bye

Coordinator
Nov 18, 2010 at 5:31 PM

adima80,

What version of the library are you using?  If you are using the latest version (4.0.2) you should be able to copy what is in the demo application under "Disclaimer.Controls.Demo/Views/ClassicCalendarExt.xaml".  There you will find the following mockup to suit your needs.  It will look like the following:

Namespaces:

xmlns:SLClassicExt="clr-namespace:Disclaimer.Controls.ClassicCalendarExt;assembly=Disclaimer.Controls.ClassicCalendarExt"
xmlns:SLClassicExtVM="clr-namespace:Disclaimer.Controls.ClassicCalendarExt.ViewModel;assembly=Disclaimer.Controls.ClassicCalendarExt"
xmlns:SLClassicExtUtil="clr-namespace:Disclaimer.Controls.ClassicCalendarExt.Utility;assembly=Disclaimer.Controls.ClassicCalendarExt"
xmlns:SLClassicExtM="clr-namespace:Disclaimer.Controls.ClassicCalendarExt.Model;assembly=Disclaimer.Controls.ClassicCalendarExt"

DataContext Resource:

<navigation:Page.Resources>
        <SLClassicExtVM:CalendarVM x:Key="cc1VM" ButtonHeight="10" ButtonWidth="10" MonthSpan="Three">
            <SLClassicExtVM:CalendarVM.LegendList>
                <SLClassicExtVM:DaySelectionValueM ID="0" Desc="Vaccant" HalfDay="True" Color="Green" />
                <SLClassicExtVM:DaySelectionValueM ID="1" Desc="Occupied" HalfDay="True" Color="Orange" />
                <SLClassicExtVM:DaySelectionValueM ID="2" Desc="High Volume" HalfDay="True" Color="Yellow" />
            </SLClassicExtVM:CalendarVM.LegendList>
        </SLClassicExtVM:CalendarVM>
</navigation:Page.Resources>

Control Definition:

<Grid x:Name="LayoutRoot" Background="White">
<SLClassicExt:ucCalendar DataContext="{StaticResource cc1VM}"/>
</Grid>

I hope this helps.

Dixxieonmymind
Nov 19, 2010 at 7:30 AM

Hi,

* I'm using the latest version

* I get the calendar assembly form the "bin" folder of demo project that this site provide. These are the assembly that I've referenced: Disclaimer.Control.Buttons.dll, Disclaimer.Control.ClassicCalendar.dll and Disclaimer.Control.ClassiCalendarExt.dll.

* Using your suggestion I alway get the exception, but now I see the header bar of calendar, the navigation buttons, the hour type icon but I don't see the calendar plan.

* I'm using visual studio 2010 with the latest Silverlight upgrades.

 

Thanks againg, bye.

Alessandro

Coordinator
Nov 19, 2010 at 12:30 PM
What is the exception you are getting? If you put a break point in
the App.xaml code file in the exception event and look at the variable
"e" you will see the exception and the inner exception. If you can
tell me what these say I might be able to help a little more.

On Fri, Nov 19, 2010 at 2:30 AM, [email removed] wrote:
> From: adima80
>
> Hi,
>
> * I'm using the latest version
>
> * I get the calendar assembly form the "bin" folder of demo project that
> this site provide. These are the assembly that I've referenced:
> Disclaimer.Control.Buttons.dll, Disclaimer.Control.ClassicCalendar.dll and
> Disclaimer.Control.ClassiCalendarExt.dll.
>
> * Using your suggestion I alway get the exception, but now I see the header
> bar of calendar, the navigation buttons, the hour type icon but I don't see
> the calendar plan.
>
> * I'm using visual studio 2010 with the latest Silverlight upgrades.
>
>
>
> Thanks againg, bye.
>
> Alessandro
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed]@discussions.codeplex.com)
>
> To start a new discussion for this project, email
> [email removed]@discussions.codeplex.com
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe or change your settings on codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at codeplex.com
Nov 22, 2010 at 10:19 AM

Hi, I found the problem: I was missing a reference to System.Windows.Controls.Toolkit!!

 

Thanks for the attention.