[SOLVED] Designer preview issue when used with common style

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
sd1388
Posts: 34
Joined: Mon Jan 30, 2017 9:51 am

[SOLVED] Designer preview issue when used with common style

Postby sd1388 » Thu Feb 23, 2017 5:07 am

Hi Team,

I have used DefaultStyle.xaml in project where all common styles are defined. I then merged that defaultstyle with App.xaml using following syntax.

<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="DefaultStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

After doing this, I am not able to view design in designer but styling is properly applied when page is rendered on browser.
We are not able to see actual design in designer which consumes our time to judge when placing controls on UI.

Is it known behaviour or I am missing any configuration?

Please suggest.

Thanks.
Last edited by sd1388 on Thu Mar 23, 2017 6:03 am, edited 1 time in total.

sd1388
Posts: 34
Joined: Mon Jan 30, 2017 9:51 am

Re: Designer preview issue when used with common style

Postby sd1388 » Tue Feb 28, 2017 6:51 am

Hi Team,

Any update on this?

Thanks
Last edited by sd1388 on Thu Mar 23, 2017 6:04 am, edited 1 time in total.

tomny
Posts: 38
Joined: Sat Nov 19, 2016 7:23 pm

Re: Designer preview issue when used with custom style

Postby tomny » Tue Feb 28, 2017 6:04 pm

Hi,

Does not support the implicit style, all styles should use "key" to set.

Regards,
Tomny

sd1388
Posts: 34
Joined: Mon Jan 30, 2017 9:51 am

Re: Designer preview issue when used with custom style

Postby sd1388 » Wed Mar 01, 2017 10:23 pm

Hi,
Yes, I have already used Key attribute for custom style. design is still not shown on designer but styling is properly applied when viewed in browser.

Thanks.

sd1388
Posts: 34
Joined: Mon Jan 30, 2017 9:51 am

Re: Designer preview issue when used with common style

Postby sd1388 » Thu Mar 23, 2017 5:21 am

Hi Team,

Any update on this. ?

PFA sample for your reference.
MyTestValidation.rar
(413.38 KiB) Downloaded 388 times


I have written TextBlockStyle in DefaultStyle.xaml and referred in MainPage.xaml. It affects designer preview and thus design can't be seen.

DefaultStyle.xaml-

Code: Select all

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MyTestValidation">
    <Style x:Key="TextBlockStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="Green"/>
    </Style>

</ResourceDictionary>


MainPage.xaml-

Code: Select all

<TextBlock Text="Your First Name: " Style="{StaticResource TextBlockStyle}"/>


Does common style work? or shall I have to use inline style approach?

Please share sample of common style if it is working.

Thanks.

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Designer preview issue when used with common style

Postby JS-Support @Userware » Thu Mar 23, 2017 6:09 am

Hi,

Yes, common styles do work.

However, the XAML Designer Preview does not support them. They will work fine when you launch the final application (both in the Simulator and in the Browser). Your "MergedDictionaries" is the correct one. We will add support for the XAML Designer Preview in the future.

Thanks a lot,
Regards,
JS-Support

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Designer preview issue when used with common style

Postby JS-Support @Userware » Fri Aug 11, 2017 7:34 am

Hi,

This is now supported starting in Beta 11.8 and newer (May 2017). You can download the latest build from:
http://forums.cshtml5.com/viewforum.php?f=6

Regards,
JS-Support


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 2 guests

 

 

cron