This is a migrated thread and some comments may be shown as answers.

Office2013 theme

6 Answers 362 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christie Admin
Top achievements
Rank 1
Christie Admin asked on 31 Dec 2013, 04:36 PM
Hi,

I'm using the lates version of Telerik and I would like to change the theme to Office2013 of my usercontrol in the constructor so how I can achieve this ?!?

Thank's
Alain

6 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 02 Jan 2014, 08:16 AM
Hello Alain,

Office2013 theme is an external theme and can be applied only with Implicit Styles. For more information about it, please check the following help topic:
http://www.telerik.com/help/wpf/common-styling-appearance-office2013-theme.html.

If you have any further questions, write to us again.

Regards,
Yana
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Christie Admin
Top achievements
Rank 1
answered on 03 Jan 2014, 03:53 PM
I Yana,

I'm trying to implement the Office 2013 theme in my solution but it doesn't work :(

In my solution, I added a folder "Themes" and the foloowing files in it:

  - System.Windows.xaml
  - Telerik.Windows.Controls.Input.xaml
  - Telerik.Windows.Controls.Navigation.xaml
  - Telerik.Windows.Controls.ScheduleView.xaml
  - Telerik.Windows.Controls.xaml

In my UserControl I added the following piece of code:

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Themes/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="Themes/System.Windows.xaml" />
                <ResourceDictionary Source="Themes/Telerik.Windows.Controls.Input.xaml" />
                <ResourceDictionary Source="Themes/Telerik.Windows.Controls.Navigation.xaml" />
                <ResourceDictionary Source="Themes/Telerik.Windows.Controls.ScheduleView.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

When I try to compile, I receive the following error code:

1>------ Rebuild All started: Project: UI.DataBindingObject, Configuration: Debug Any CPU ------
1>  UI.DataBindingObject -> C:\Users\agosselin\Desktop\AppointmentControls\Client.UI.DataBindingObject\bin\Debug\Appointment.UI.UserControlDataBindingObject.dll
2>------ Rebuild All started: Project: UI.TelerikSandBox, Configuration: Debug Any CPU ------
2>C:\Users\agosselin\Desktop\AppointmentControls\Client.UI.TelerikSandBox\Themes\Telerik.Windows.Controls.Input.xaml(129,6): error MC3074: The tag 'HorizontalContentAlignmentToTextAlignmentConverter' does not exist in XML namespace 'clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input'. Line 129 Position 6.
2>C:\Users\agosselin\Desktop\AppointmentControls\Client.UI.TelerikSandBox\Themes\Telerik.Windows.Controls.Navigation.xaml(2844,203): error MC1000: Unknown build error, 'Cannot resolve dependency to assembly 'Telerik.Windows.Data, Version=2013.3.1204.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event. Line 2844 Position 203.'
2>C:\Users\agosselin\Desktop\AppointmentControls\Client.UI.TelerikSandBox\Themes\Telerik.Windows.Controls.ScheduleView.xaml(155,22): error MC3074: The tag 'RadComboBox' does not exist in XML namespace 'http://schemas.telerik.com/2008/xaml/presentation'. Line 155 Position 22.
3>------ Rebuild All started: Project: Test, Configuration: Debug Any CPU ------
3>C:\Users\agosselin\Desktop\AppointmentControls\Test\MainWindow.xaml(12,18): error MC3074: The tag 'CreateSchedule' does not exist in XML namespace 'clr-namespace:AppointmentControls.CreateSchedule;assembly=Appointment.Client.UI.TelerikSandBox'. Line 12 Position 18.
========== Rebuild All: 1 succeeded, 2 failed, 0 skipped ==========

Thank's
Alain
 
0
Christie Admin
Top achievements
Rank 1
answered on 03 Jan 2014, 08:04 PM
Hi Yana,

actually, in my project, I have 3 diffrents userControls. In my project I add a reference to the following files from the following folder "Binaries.NoXaml\WPF40":

  - Telerik.Windows.Controls
  - Telerik.Windows.Controls.Input
  - Telerik.Windows.Controls.Navigation
  - Telerik.Windows.Controls.ScheduleView
  - Telerik.Windows.Themes.Offices2013

In my UserControls xaml file, I add the following piece of code :

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/System.Windows.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Input.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.ScheduleView.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

When I run my application, I received the following message :

System.Windows.Markup.XamlParseException occurred
  HResult=-2146233087
  Message='Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '15' and line position '18'.
  Source=PresentationFramework
  LineNumber=15
  LinePosition=18
  StackTrace:
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at AppointmentControls.CreateSchedule.CreateSchedule.InitializeComponent() in c:\Users\agosselin\Desktop\AppointmentControls\Client.UI.TelerikSandBox\CreateSchedule\CreateSchedule.xaml:line 1
       at AppointmentControls.CreateSchedule.CreateSchedule..ctor() in c:\Users\agosselin\Desktop\AppointmentControls\Client.UI.TelerikSandBox\CreateSchedule\CreateSchedule.xaml.cs:line 28
  InnerException: System.IO.FileNotFoundException
       HResult=-2147024894
       Message=Could not load file or assembly 'Telerik.Windows.Themes.Windows8, Culture=neutral' or one of its dependencies. Le fichier spécifié est introuvable.
       Source=mscorlib
       FileName=Telerik.Windows.Themes.Windows8, Culture=neutral
       FusionLog==== Pre-bind state information ===
LOG: DisplayName = Telerik.Windows.Themes.Windows8, Culture=neutral
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Telerik.Windows.Themes.Windows8, Culture=neutral | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/agosselin/Desktop/AppointmentControls/Test/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\agosselin\Desktop\AppointmentControls\Test\bin\Debug\Test.vshost.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/agosselin/Desktop/AppointmentControls/Test/bin/Debug/Telerik.Windows.Themes.Windows8.DLL.
LOG: Attempting download of new URL file:///C:/Users/agosselin/Desktop/AppointmentControls/Test/bin/Debug/Telerik.Windows.Themes.Windows8/Telerik.Windows.Themes.Windows8.DLL.
LOG: Attempting download of new URL file:///C:/Users/agosselin/Desktop/AppointmentControls/Test/bin/Debug/Telerik.Windows.Themes.Windows8.EXE.
LOG: Attempting download of new URL file:///C:/Users/agosselin/Desktop/AppointmentControls/Test/bin/Debug/Telerik.Windows.Themes.Windows8/Telerik.Windows.Themes.Windows8.EXE.

       StackTrace:
            at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
            at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
            at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
            at System.Windows.Navigation.BaseUriHelper.GetLoadedAssembly(String assemblyName, String assemblyVersion, String assemblyKey)
            at MS.Internal.AppModel.ResourceContainer.GetResourceManagerWrapper(Uri uri, String& partName, Boolean& isContentFile)
            at MS.Internal.AppModel.ResourceContainer.GetPartCore(Uri uri)
            at System.IO.Packaging.Package.GetPart(Uri partUri)
            at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
            at System.IO.Packaging.PackWebResponse.get_ContentType()
            at MS.Internal.WpfWebRequestHelper.GetContentType(WebResponse response)
            at MS.Internal.WpfWebRequestHelper.GetResponseStream(WebRequest request, ContentType& contentType)
            at System.Windows.ResourceDictionary.set_Source(Uri value)
            at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
       InnerException:
0
Masha
Telerik team
answered on 06 Jan 2014, 08:38 AM
Hi Alain,

We were not able to reproduce the described issue. Would you please confirm that you referenced the NoXaml DLLs when using the implicit styles approach. Also you need to remove any StyleManager definition in the project in order the theme to be applied correctly.

Please review the attached project. If you still have any problems please send us a runnable project to investigate the issue in more detail.

Regards,
Masha
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Christie Admin
Top achievements
Rank 1
answered on 06 Jan 2014, 02:58 PM
Hi Masha,

is this possble because the ResourceDictionary was set into a UserControl??? Aloso we sign our assembly!!!

Thank's
Alain
0
Christie Admin
Top achievements
Rank 1
answered on 06 Jan 2014, 08:56 PM
I just found it, thank's lolll
Tags
General Discussions
Asked by
Christie Admin
Top achievements
Rank 1
Answers by
Yana
Telerik team
Christie Admin
Top achievements
Rank 1
Masha
Telerik team
Share this question
or