We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Image in chromeless wpf window title

Thread ID:

Created:

Updated:

Platform:

Replies:

124801 Jun 30,2016 11:41 AM Aug 15,2016 01:31 AM WPF 12
loading
Tags: ChromelessWindow
Gianni Ghezzi
Asked On June 30, 2016 11:41 AM

I'd like to know if I can use an image in the chromeless wpf window bar instead the standard icon, like the application "Syncfusion Metro Studio 5".
Thanks!

Sugapriya Mariappan [Syncfusion]
Replied On July 1, 2016 05:13 AM

Hi Gianni,

Thank you for contacting Syncfusion Support.

We have prepared a sample based on your update.In this sample we have set Icon for the ChromelessWindow using the “Icon” property

Sample:ChromelessWindowSample

If your requirement is different from this sample, please provide more information about your requirement

Regards,
M.Sugapriya


Gianni Ghezzi
Replied On July 1, 2016 09:57 AM

I know how to use icon property but I meant an image like your Syncfusion Metro Studio 5, see the image below:

Image in title bar

Gianni Ghezzi
Replied On July 1, 2016 11:01 AM

Ok, working around ChromelessWindow_137910 example I was able to add images to title bar using the resourceDirectory ControlTemplate definition for TitleBarTemplate.
Is it the right way?
Thanks!

Gianni Ghezzi
Replied On July 1, 2016 11:57 AM

I've created my custom ChromelessWindow template, on design I can view my template right and I'm able to compile but when I run the application I receive an exception:
Exception thrown: 'System.Windows.Markup.XamlParseException' in PresentationFramework.dll
See the screen shot below:
ScreenShotChromelessException.jpg
Any idea to fix it?
Thanks!

Venkateshwaran Ramdoss [Syncfusion]
Replied On July 4, 2016 11:33 AM

Hi Gianni,

We have prepared a sample based on your requirement. In this sample we have edit the ChromelessWindow Template by using ControlTemplate. Please download the sample from the below link.

Sample: ChromelessWindowSample

Regards,
Venkateshwaran V.R.

Gianni Ghezzi
Replied On July 5, 2016 06:06 AM

Thanks for your help but I'm struggling to fix this!
I've replicated your example in my project, I'm able to see right the ChromelessWindow template at design time but when I execute my project I receive an XamlParseException exception .
I've also tried to load your template without any modification in my project but when I add the line Template="{StaticResource ChromelessWindowTemplate}" in MainWindow.xaml I receive the same exception!


Link to the screenshot
 

Gianni Ghezzi
Replied On July 5, 2016 06:29 AM

This is the details of the exception (it seems a problem around titlebar element):

System.Windows.Markup.XamlParseException verificata
  HResult=-2146233087
  LineNumber=11
  LinePosition=9
  Message='È stata generata un'eccezione durante la specifica di un valore su 'System.Windows.StaticResourceExtension'.' numero riga '11' e posizione riga '9'.
  Source=PresentationFramework
  StackTrace:
       in System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       in System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       in System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       in System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       in Codepoint.EasyWarehouse.WpfRegistrationUtility.MainWindow.InitializeComponent() in C:\Users\Ricky\Documents\TFS Repos\WpfRegistrationUtility\MainWindow.xaml:riga 1
  InnerException:
       HResult=-2146233088
       LineNumber=0
       LinePosition=0
       Message=Record imprevisto nel flusso Baml. Tentativo di aggiungere a TitleBar che non è una raccolta o ha un TypeConverter.
       Source=PresentationFramework
       StackTrace:
            in System.Windows.Baml2006.Baml2006Reader.InjectPropertyAndFrameIfNeeded(XamlType elementType, SByte flags)
            in System.Windows.Baml2006.Baml2006Reader.Process_ElementStart()
            in System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
            in System.Windows.Baml2006.Baml2006Reader.ReadObject(KeyRecord record)
            in System.Windows.ResourceDictionary.CreateObject(KeyRecord key)
            in System.Windows.ResourceDictionary.OnGettingValue(Object key, Object& value, Boolean& canCache)
            in System.Windows.ResourceDictionary.OnGettingValuePrivate(Object key, Object& value, Boolean& canCache)
            in System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
            in System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
            in System.Windows.ResourceDictionary.FetchResource(Object resourceKey, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean canCacheAsThemeResource, Boolean& canCache)
            in System.Windows.FrameworkElement.FindResourceInternal(FrameworkElement fe, FrameworkContentElement fce, DependencyProperty dp, Object resourceKey, Object unlinkedParent, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, DependencyObject boundaryElement, Boolean isImplicitStyleLookup, Object& source)
            in System.Windows.StaticResourceExtension.FindResourceInAppOrSystem(IServiceProvider serviceProvider, Boolean allowDeferredReference, Boolean mustReturnDeferredResourceReference)
            in System.Windows.StaticResourceExtension.FindResourceInEnviroment(IServiceProvider serviceProvider, Boolean allowDeferredReference, Boolean mustReturnDeferredResourceReference)
            in System.Windows.StaticResourceExtension.TryProvideValueInternal(IServiceProvider serviceProvider, Boolean allowDeferredReference, Boolean mustReturnDeferredResourceReference)
            in System.Windows.StaticResourceExtension.ProvideValueInternal(IServiceProvider serviceProvider, Boolean allowDeferredReference)
            in System.Windows.StaticResourceExtension.ProvideValue(IServiceProvider serviceProvider)
            in MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
       InnerException:

Venkateshwaran Ramdoss [Syncfusion]
Replied On July 6, 2016 07:49 AM

Hi Gianni,

We can directly set the ChromlessWindow Template. We have prepared a sample which can be downloaded from the below link.

Sample: ChromelessWindowSample

Please ensure whether all ControlTemplate of ResourceDictionary in App.xaml are used as in our sample.

Regards,
Venkateshwaran V.R. 


Gianni Ghezzi
Replied On August 11, 2016 09:07 AM

Very Thanks! This sample is very useful and It allowed me to customize in detail my chromeless windows bar but I've some problem adding control on the windows.
For example if you try to add a SFDataGrid control to your above example it give exceptions and is no more possible to run it.
Can you explain me please the needed step to add other controls into the templated chromeless window.
Surely I missed something but don't understand what!
Thanks!

Sugapriya Mariappan [Syncfusion]
Replied On August 12, 2016 03:23 AM

HI Gianni,

We have modified our last updated sample to meet your requirement. In this sample we have added SfDataGrid control to our ChromelessWindow.

Please download the modified sample from the below link
Sample:ChromelessWindowSample

Could you please check the sample and let us know the result?

Regards,
M.Sugapriya


Gianni Ghezzi
Replied On August 12, 2016 09:08 AM

Thanks, I've solved.
Adding controls directly from toolbox often is added bad dll version that do not match the targeting of the project and it causes problems and incomprehensible behavior.
The only workaround is to be careful and manually add all the necessary dll for each SF control before add it on the project.

Sugapriya Mariappan [Syncfusion]
Replied On August 15, 2016 01:31 AM

Hi Gianni,

Thank you for your update.

Please let us know if you need any other assistance

Regards,
M.Sugapriya


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;