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

Styles defined in Resource Dictionary are not accessable through ContentView.Resources in Telerik login screen

3 Answers 73 Views
Entry
This is a migrated thread and some comments may be shown as answers.
Sreekumary
Top achievements
Rank 1
Sreekumary asked on 06 Aug 2019, 06:02 AM

Hi,

 

I am new to Xamarin forms. I created a project and add a Telerik login screen to the project. I am facing some issues

    I have a Login xaml page ,here I have text fields like username and password and some social image icons .There is another  page for styling these login screen named Styles.xaml and it has some styles, these styles are declared using Resource Dictionary. I try to access these styles using  <ResourceDictionary Source="Styles.xaml" />. But the problem is , these styles are not visible. Text field and image icons are not visible.

Please get me a solution. I researched lot

 

My code samples are here:

Login.xaml,styles.xaml  and design page are attached bleow. Please find these

 

 

3 Answers, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 06 Aug 2019, 07:59 PM
Hello Sreekumary,

This looks like a Visual Studio designer issue. Can you compile and deploy it to confirm that the styles are respected at runtime?

Generally speaking, the Xamarin.Forms designer is unreliable (I personally always have it disabled). Microsoft has been working on it, but it's not like WPF or UWP. They are releasing a new tool call Hot Reload that will make designing Xamarin.Forms app easier because it support native controls 100% (but it's not RTM yet).

If the control is a native control, it won't work in the designer because it requires the native platform to compile and render it via the platform renderer (many of our controls are native controls). Though if the control is a SkiaSharp-based control, then it will sometimes work in the designer assuming all resources are built.

This brings me to the MergedResources part of the XAML, I'm not sure that the designer is properly merging the ResourceDictionaries at design time, thus leads to what you're seeing.

Let me know how it goes after you compile and deploy the project.

Regards,
Lance | Technical Support Engineer, Principal
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
ahmed
Top achievements
Rank 1
answered on 28 Jan 2020, 02:39 PM

i have the same problem and when i compile and run on emulator it doesn't appear too

 

please help

0
Lance | Manager Technical Support
Telerik team
answered on 28 Jan 2020, 04:03 PM

Hello Ahmed,

If you continue to have issues with HotReload or similar, you can just move the resources out of the Styles.xaml ResourceDictionary and put them into your App.xaml instead.

Once they're moved you can delete the file and remove the MergedDictionaries lines.

Regards,
Lance | Team Lead - US DevTools Support
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Entry
Asked by
Sreekumary
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
ahmed
Top achievements
Rank 1
Share this question
or