app.xaml doesn't work in framework 4.5

Hi,

I have a WPF project in Framework 4.0 which works fine. Now I need to upgrade to Framework 4.5 and I run into problems. I have an app.xaml file with this content:

<Application x:Class="ScheduleViewDB.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerikScheduleView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"
             xmlns:telerik1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:viewModel="clr-namespace:ScheduleViewDB.ViewModels"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/System.Windows.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.ScheduleView.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <viewModel:ProjectViewModel x:Key="projectViewModel" />
                                               
            <ControlTemplate x:Key="CustomEditAppointmentTemplate" TargetType="telerikScheduleView:SchedulerDialog">
                <Grid IsSharedSizeScope="True">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <telerik:RadToolBar x:Name="AppointmentToolbar" GripVisibility="Collapsed" Grid.Row="0" Margin="-1 -1 -1 3" FocusManager.IsFocusScope="False">
                        <telerik:RadButton x:Name="EditRecurrenceButton"
                        AutomationProperties.AutomationId="EditRecurrenceButton"
                        Command="{x:Static telerikScheduleView:RadScheduleViewCommands.EditRecurrenceRule}"
                        Visibility="{Binding CanEditParentAppointment, Converter={StaticResource InvertedBooleanToVisibilityConverter}}">
                            <ToolTipService.ToolTip>
                                <ToolTip telerik:LocalizationManager.ResourceKey="EditRecurrence"/>
                            </ToolTipService.ToolTip>
                            <StackPanel Orientation="Horizontal" Margin="2 0">
                                <!--<Image
                                Margin="2 0"
                                Stretch="None"
                                Source="{StaticResource EditAppointmentTemplate_Recurrence}"
                                RenderOptions.BitmapScalingMode="NearestNeighbor"
                                RenderOptions.EdgeMode="Aliased"/>-->
                                <TextBlock Margin="4 0" telerik:LocalizationManager.ResourceKey="EditRecurrence"/>
                            </StackPanel>
                        </telerik:RadButton>
                        <telerik:RadButton x:Name="EditParentAppointmentButton"
                        AutomationProperties.AutomationId="EditParentAppointmentButton"
                        IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}"
                        Command="{x:Static telerikScheduleView:RadScheduleViewCommands.EditParentAppointment}"
                        Visibility="{Binding CanEditParentAppointment, Converter={StaticResource BooleanToVisibilityConverter}}">
                            <ToolTipService.ToolTip>
                                <TextBlock telerik:LocalizationManager.ResourceKey="EditParentAppointment"/>
                            </ToolTipService.ToolTip>
                            <TextBlock Margin="4 0" telerik:LocalizationManager.ResourceKey="EditParentAppointment"/>
                        </telerik:RadButton>
                        <telerik:RadToolBarSeparator/>
                        <TextBlock x:Name="ShowAs" telerik:LocalizationManager.ResourceKey="ShowAs" VerticalAlignment="Center" Margin="6 0"/>
                        <telerik:RadComboBox x:Name="PART_TimeMarkers"
                        AutomationProperties.AutomationId="PART_TimeMarkers"
                        Margin="2 1"
                        Width="150"
                        IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}"
                        EmptyText="{Binding TimeMarkersEmptyText}"
                        ItemsSource="{Binding TimeMarkers}"
                        SelectedItem="{Binding Occurrence.Appointment.TimeMarker, Mode=TwoWay}"
                        ClearSelectionButtonVisibility="Visible"
                        ClearSelectionButtonContent="{Binding ClearSelectionButtonContent}"
                        ItemTemplate="{StaticResource TimeMarkerComboBoxItemContentTemplate}"
                        SelectionBoxTemplate="{StaticResource TimeMarkerComboBoxItemContentTemplate}"/>
                        <telerik:RadComboBox x:Name="PART_Categories"
                        AutomationProperties.AutomationId="PART_Categories"
                        Margin="2 1"
                        Width="120"
                        IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}"
                        EmptyText="{Binding CategoriesEmptyText}"
                        ItemsSource="{Binding Categories}"
                        SelectedItem="{Binding Occurrence.Appointment.Category, Mode=TwoWay}"
                        ClearSelectionButtonVisibility="Visible"
                        ClearSelectionButtonContent="{Binding ClearSelectionButtonContent}"
                        ItemTemplate="{StaticResource CategoryComboBoxItemContentTemplate}"
                        SelectionBoxTemplate="{StaticResource CategoryComboBoxItemContentTemplate}"/>
                        <telerik:RadToggleButton x:Name="HighImportaceButton"
                        AutomationProperties.AutomationId="HighImportaceButton"
                        Width="22"
                        Height="22"
                        IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}"
                        IsChecked="{Binding IsHighImportance, Mode=TwoWay}">
                            <ToolTipService.ToolTip>
                                <ToolTip telerik:LocalizationManager.ResourceKey="HighImportance"/>
                            </ToolTipService.ToolTip>
                            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                                <Path
                                Stretch="Fill"
                                Height="10"
                                HorizontalAlignment="Center"
                                Width="5.451"
                                Data="M200.39647,58.840393 C200.39337,58.336426 201.14566,57.683922 202.56244,57.684292 C204.06589,57.684685 204.73764,58.357765 204.72783,58.992363 C205.04649,61.795574 203.04713,64.181099 202.47388,66.133446 C201.93753,64.154961 199.9471,61.560352 200.39647,58.840393 z">
                                    <Path.Fill>
                                        <LinearGradientBrush EndPoint="1.059,0.375" StartPoint="-0.457,0.519">
                                            <GradientStop Color="#FFFF0606" Offset="0.609"/>
                                            <GradientStop Color="#FFBF0303" Offset="0.927"/>
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                </Path>
                                <Ellipse Width="3" Height="3" HorizontalAlignment="Center">
                                    <Ellipse.Fill>
                                        <RadialGradientBrush>
                                            <GradientStop Color="#FFFF0606" Offset="0"/>
                                            <GradientStop Color="#FFBF0303" Offset="1"/>
                                        </RadialGradientBrush>
                                    </Ellipse.Fill>
                                </Ellipse>
                            </StackPanel>
                        </telerik:RadToggleButton>
                        <telerik:RadToggleButton x:Name="LowImportaceButton"
                        AutomationProperties.AutomationId="LowImportaceButton"
                        Width="22"
                        Height="22"
                        IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}"
                        IsChecked="{Binding IsLowImportance, Mode=TwoWay}">
                            <ToolTipService.ToolTip>
                                <ToolTip telerik:LocalizationManager.ResourceKey="LowImportance"/>
                            </ToolTipService.ToolTip>
                            <Path
                            Stretch="Fill"
                            Height="12"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Width="9"
                            Stroke="#FF0365A7"
                            Data="M222.40353,60.139881 L226.65768,60.139843 L226.63687,67.240196 L229.15347,67.240196 L224.37816,71.394943 L219.65274,67.240196 L222.37572,67.219345 z">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="1.059,0.375" StartPoint="-0.457,0.519">
                                        <GradientStop Color="#FFBBE4FF"/>
                                        <GradientStop Color="#FF024572" Offset="0.836"/>
                                        <GradientStop Color="#FF43ADF4" Offset="0.466"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                        </telerik:RadToggleButton>
                    </telerik:RadToolBar>
                    <Border x:Name="AppointmentCategory"
                    Grid.Row="1"
                    Height="20"
                    Margin="6 6"
                    CornerRadius="3"
                    Background="{Binding SelectedItem.CategoryBrush, ElementName=PART_Categories}"
                    Visibility="{Binding SelectedItem, ElementName=PART_Categories,Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Margin="6 0" Text="{Binding SelectedItem.DisplayName, ElementName=PART_Categories}" VerticalAlignment="Center"/>
                    </Border>
                    <Grid x:Name="Details" Grid.Row="2" Margin="6">
                        <Grid.Resources>
                            <telerik:InputMode x:Key="RadDateTimePickerInputModeDatePicker">DatePicker</telerik:InputMode>
                        </Grid.Resources>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MinWidth="100" SharedSizeGroup="LabelsGroup"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Row="0" Grid.Column="0" Margin="6" telerik:LocalizationManager.ResourceKey="Subject"/>
                        <TextBox
                        AutomationProperties.AutomationId="SubjectTextBox"
                        Grid.Row="0"
                        Grid.Column="1"
                        Grid.ColumnSpan="2"
                        Margin="3"
                        IsReadOnly="{Binding IsReadOnly}"
                        Text="{Binding Occurrence.Appointment.Subject, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"/>
                        <TextBlock Grid.Row="1" Grid.Column="0" Margin="6" telerik:LocalizationManager.ResourceKey="Body"/>
                        <TextBox
                        AutomationProperties.AutomationId="DescriptionTextBox"
                        Grid.Row="1"
                        Grid.Column="1"
                        Grid.ColumnSpan="2"
                        Margin="3"
                        Height="70"
                        IsReadOnly="{Binding IsReadOnly}"
                        VerticalAlignment="Stretch"
                        VerticalContentAlignment="Stretch"
                        VerticalScrollBarVisibility="Visible"
                        Text="{Binding Occurrence.Appointment.Body,ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"
                        TextWrapping="Wrap"/>
                        <TextBlock Grid.Row="2" Grid.Column="0" Margin="6" telerik:LocalizationManager.ResourceKey="StartTime"/>
                        <telerik:RadDateTimePicker
                        AutomationProperties.AutomationId="StartTimeDateTimePicker"
                        Grid.Row="2"
                        Grid.Column="1"
                        Margin="3"
                        IsReadOnly="{Binding IsReadOnly}"
                        Culture="{Binding DefaultCulture,Source={StaticResource LocalizationManager}}"
                        SelectedValue="{Binding ActualStart, Mode=TwoWay, ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                        IsEnabled="{Binding IsNotRecurrent}"
                        InputMode="{Binding IsAllDayEvent, Converter={StaticResource BoolToInputModeConverter}, ConverterParameter={x:Static telerik:InputMode.DatePicker}}"/>
                        <TextBlock Grid.Row="3" Grid.Column="0" Margin="6" VerticalAlignment="Center" telerik:LocalizationManager.ResourceKey="EndTime"/>
                        <telerik:RadDateTimePicker
                        AutomationProperties.AutomationId="EndTimeDateTimePicker"
                        Grid.Row="3"
                        Grid.Column="1"
                        Margin="3"
                        SelectedValue="{Binding ActualEnd, Mode=TwoWay, ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                        IsReadOnly="{Binding IsReadOnly}"
                        Culture="{Binding DefaultCulture, Source={StaticResource LocalizationManager}}"
                        IsEnabled="{Binding IsNotRecurrent}"
                        InputMode="{Binding IsAllDayEvent, Converter={StaticResource BoolToInputModeConverter}, ConverterParameter={x:Static telerik:InputMode.DatePicker}}"/>
                        <CheckBox x:Name="AllDayEventCheckbox"
                        AutomationProperties.AutomationId="AllDayEventCheckbox"
                        Grid.Row="4"
                        Grid.Column="1"
                        Margin="3"
                        VerticalAlignment="Center"
                        IsChecked="{Binding Path=IsAllDayEvent, Mode=TwoWay}"
                        IsEnabled="{Binding IsNotRecurrent}"
                        telerik:LocalizationManager.ResourceKey="AllDayEvent"/>
                        <!--ADDED CONTROLS-->
                        <TextBlock Grid.Row="5" Grid.Column="0" Margin="6, 9, 0, 3" Text="Uppdrag" />
                        <telerik:RadComboBox x:Name="cbProject" Grid.Row="5" Grid.Column="1" Margin="3"
                                                EmptyText="Välj uppdrag ..."
                                                CanAutocompleteSelectItems="True"
                                                IsEditable="True"
                                                IsReadOnly="False"
					                            OpenDropDownOnFocus="True"
					                            IsFilteringEnabled="True"
					                            TextSearchMode="Contains"
					                            IsDropDownOpen="False"
                                                MaxDropDownHeight="300"
                                                SelectedValue="{Binding Occurrence.Appointment.ProjectID}"
                                                ItemsSource="{Binding Source={StaticResource projectViewModel}, Path=Projects}"
                                                SelectedValuePath="ProjectID"
                                                DisplayMemberPath="Name"/>
                    </Grid>
                    <Grid Grid.Row="3" Margin="3" Visibility="{Binding ResourceTypesVisibility}">
                        <ItemsControl x:Name="PART_Resources"
                        Margin="3"
                        IsTabStop="false"
                        BorderBrush="{x:Null}"
                        BorderThickness="0"
                        HorizontalContentAlignment="Stretch"
                        VerticalContentAlignment="Stretch"
                        IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}"
                        ItemsSource="{Binding ResourceTypes}"
                        ItemTemplateSelector="{StaticResource ResourcesEditorItemTemplateSelector}"
                        Visibility="{Binding ResourceTypesVisibility}"/>
                        <TextBlock
                        HorizontalAlignment="Center"
                        Text="You can only change the resources by opening the series"
                        Margin="3"
                        Visibility="{Binding ResourceTypesVisibility, Converter={StaticResource InvertedVisibilityConverter}}"/>
                    </Grid>
                    <StackPanel Grid.Row="4" Margin="13 6" HorizontalAlignment="Right" Orientation="Horizontal">
                        <telerik:RadButton
                        AutomationProperties.AutomationId="OKButton"
                        Margin="2"
                        MinWidth="84"
                        Command="{x:Static telerik1:WindowCommands.Confirm}"
                        telerik:LocalizationManager.ResourceKey="Ok"
                        telerik:RadWindow.ResponseButton="Accept">
                            <ToolTipService.ToolTip>
                                <TextBlock telerik:LocalizationManager.ResourceKey="SaveAndClose"/>
                            </ToolTipService.ToolTip>
                        </telerik:RadButton>
                        <telerik:RadButton
                        AutomationProperties.AutomationId="CancelButton"
                        Margin="2"
                        MinWidth="84"
                        Command="{x:Static telerik1:WindowCommands.Cancel}"
                        telerik:LocalizationManager.ResourceKey="Cancel"
                        telerik:RadWindow.ResponseButton="Cancel"/>
                    </StackPanel>
                </Grid>
            </ControlTemplate>
            <Style BasedOn="{StaticResource EditAppointmentDialogStyle}" TargetType="telerikScheduleView:SchedulerDialog" x:Key="CustomEditAppointmentDialogStyle">
                <Setter Property="Template" Value="{StaticResource CustomEditAppointmentTemplate}"/>
            </Style>
            <DataTemplate x:Key="AppointmentTemplate">
                <StackPanel Orientation="Horizontal" MaxWidth="250" Background="{Binding Appointment.BackgroundBrush}" Margin="2">
                    <StackPanel Margin="0 2 0 0">
                        <TextBlock Text="{Binding Subject}" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                        <!--<TextBlock Text="{Binding Category.DisplayName}" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="emp ID" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                            <TextBlock Text="{Binding Appointment.EmployeeID}" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10, 0, 0, 0"/>
                        </StackPanel>-->
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="proj ID" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                            <TextBlock Text="{Binding Appointment.ProjectID}" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10, 0, 0, 0"/>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </DataTemplate>
            <DataTemplate x:Key="AppointmentToolTipTemplate">
                <StackPanel Orientation="Vertical" MaxWidth="500" Background="Black">
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="{Binding Subject}" TextWrapping="Wrap" Margin="0 3 4 3" FontWeight="Bold" />
                        <StackPanel Orientation="Horizontal" Margin="0 0 0 0">
                            <TextBlock Text="{Binding Start, StringFormat='hh:mm tt', Mode=TwoWay}" TextWrapping="Wrap" FontSize="13" />
                            <TextBlock Text=" - " FontSize="13" />
                            <TextBlock Text="{Binding End, StringFormat='hh:mm tt', Mode=TwoWay}" TextWrapping="Wrap" FontSize="13" />
                        </StackPanel>
                        <TextBlock Text="{Binding Start, StringFormat='dddd dd MMM yyyy', Mode=TwoWay}" Margin="0 3" FontSize="13" />
                        <TextBlock Text="{Binding Appointment.Body}" Margin="0 3 5 8" TextWrapping="Wrap" FontSize="13" />
                    </StackPanel>
                </StackPanel>
            </DataTemplate>
        </ResourceDictionary>
    </Application.Resources>
</Application>

Open in new window


and it seems to be the problem. If I remove the resource dictionary everything is working fine - except that I loose my templates. What can I do to fix this?

Best regards
RTSOL
RTSolAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Have you checked to make sure that your version of Telerik controls supports .Net Framework 4.5?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RTSolAuthor Commented:
Hi,

Yes they do. I have another project with lots of Telerik controls and it works fine. When I include the markup in the app.xaml above it alos doesn't work.

-RTSOL
0
RTSolAuthor Commented:
Hi,

You where right - the dll Telerik.Windows.Themes.Windows8Touch was for Framework 4.0. I changed it and all works.

Thanks!
0
Fernando SotoRetiredCommented:
Not a problem, glad it all worked out for you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Frameworks

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.