timheuer / callisto

A control toolkit for Windows 8 XAML applications. Contains some UI controls to make it easier to create Windows UI style apps for the Windows Store in accordance with Windows UI guidelines.
http://timheuer.com/blog/archive/2012/05/31/introducing-callisto-a-xaml-toolkit-for-metro-apps.aspx
Other
338 stars 108 forks source link

SettingsFlyout only works well within Light theme app #16

Closed timheuer closed 11 years ago

timheuer commented 12 years ago

Because the SettingsFlyout design is a light theme, the default is dark text, which is fine. The problem arises when a user chooses dark theme app (in App.xaml) and then the text on the SettingsFlyout will be all light, making it miserable.

What needs to happen is overrides within the SettingsFlyout by having theme resources defined in generic.xaml. The problem is that they all have to be defined again (including all variants for Menu and other defined brushes within Theme RDs. Having Issue #1 resolved might help this

stefanolson commented 12 years ago

Tim,

I have resolved this problem by copying the generic.xaml as suggested here (http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/adeed6be-ce16-4883-80ec-066cab743b72). I have then renamed all brushes (replaced Theme with InverseTheme), swapped the light to dark, and it does what I want. All I have to do is include the resource dictionary at the top of my control to be placed in the settings flyout.

I can make my inversegeneric.xaml available to you if you wish to include it in future builds.

...Stefan

timheuer commented 12 years ago

interestingly this is what I'm working on for Callisto as well. Warning though as including this will significantly impact performance of your application. The approach i was going to take was to separate the brushes/templates so that if you only need Button and ToggleSwitch for example, you can just add those two without paying the parsing penalty for things you won't use.

I called mine InvertedTheme :-)

If you want to post your inversegeneric.xaml I can compare. There are more than brushes that are affected as some borders in light are different thickness values.

-th

On Tue, Jun 5, 2012 at 4:16 PM, stefanolson < reply@reply.github.com

wrote:

Tim,

I have resolved this problem by copying the generic.xaml as suggested here ( http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/adeed6be-ce16-4883-80ec-066cab743b72). I have then renamed all brushes (replaced Theme with InverseTheme), swapped the light to dark, and it does what I want. All I have to do is include the resource dictionary at the top of my control to be placed in the settings flyout.

I can make my inversegeneric.xaml available to you if you wish to include it in future builds.

...Stefan


Reply to this email directly or view it on GitHub: https://github.com/timheuer/callisto/issues/16#issuecomment-6139411

stefanolson commented 12 years ago

I literally swapped everything from light to dark, so that it would take care of border thickness etc... My plan was to waste as little time as possible on it, but get something that worked so I can be ready for the store.

I only include the resource dictionary in pages where it is required, most of the time I can just change foreground and get away with it. I haven't noticed any performance degradation when opening the settings fly out. Seems to pop out very quickly still.

Where is the best place to post the xaml file, doesn't seem to like me putting it in here directly.

...Stefan

timheuer commented 12 years ago

This is only the brushes though...the control templates are still using the originally named resources, so you have to change those as well. Are you seeing this actually working?


http://timheuer.com/blog/ twitter: @timheuer

On Tue, Jun 5, 2012 at 4:59 PM, stefanolson < reply@reply.github.com

wrote:

inversegeneric.xaml:

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

``` Segoe ``` UI Segoe UI Symbol ``` 68 2/x:Double 21/x:Double 14.667/x:Double 4/x:Double 0.55/x:Double 0.60/x:Double 40.0/x:Double 4/x:Double 6/x:Double 2/x:Double 0/x:Double 6/x:Double 11/x:Double 0.8/x:Double 0.45/x:Double 0.87/x:Double 0.73/x:Double 32/x:Double 64/x:Double 12/x:Double 0,2,0,0 0,0,0,2 0,0,0,2 0,2,0,0 0 2 2 1 0 2 0 0 1 0 2 10,3,10,5 2 2 ``` ``` Segoe ``` UI Segoe UI Symbol ``` 68 2/x:Double 21/x:Double 14.667/x:Double 4/x:Double 0.55/x:Double 0.60/x:Double 40.0/x:Double 4/x:Double 8/x:Double 2/x:Double 1/x:Double 6/x:Double 11/x:Double 1/x:Double 1/x:Double 1/x:Double 1/x:Double 32/x:Double 64/x:Double 12/x:Double 0,2,0,0 0,0,0,2 0,0,0,2 0,2,0,0 2 2 2 1 2 2 1 2 1 1 2 10,3,10,5 2 2 ```
stefanolson commented 12 years ago

That's because it got cut off by this messaging system :-) have e-mailed you the full file. Yes, works very well for me. I'm not entirely sure if it would work with content in an itemscontrol, because they don't seem to pick up implicit styles, for some very complex reason that I don't quite understand :-)

...Stefan

timheuer commented 12 years ago

you should see a massive difference in startup if you are including this file. Double-parsing generic.xaml basically. In that form you'd be at risk of not passing certification for too long to startup.


http://timheuer.com/blog/ twitter: @timheuer

On Tue, Jun 5, 2012 at 8:27 PM, stefanolson < reply@reply.github.com

wrote:

That's because it got cut off by this messaging system :-) have e-mailed you the full file. Yes, works very well for me. I'm not entirely sure if it would work with content in an itemscontrol, because they don't seem to pick up implicit styles, for some very complex reason that I don't quite understand :-)

...Stefan


Reply to this email directly or view it on GitHub: https://github.com/timheuer/callisto/issues/16#issuecomment-6142288

stefanolson commented 12 years ago

Tim,

Why would it parse the file when it isn't being loaded? I only load it in the settings control.

...Stefan

timheuer commented 12 years ago

Right, but when you load that control I'd imagine it is slow.

Compared to isolating only what you need.

So:

ResourceDictionary Source=invertedtoggleswitch.xaml ResourceDictionary Source=invertedbutton.Xaml

instead of RD Source=anotherwholefriggingeneric.xaml :-0

-th


http://timheuer.com/blog/ twitter: @timheuer

On Tue, Jun 5, 2012 at 9:13 PM, stefanolson < reply@reply.github.com

wrote:

Tim,

Why would it parse the file when it isn't being loaded? I only load it in the settings control.

...Stefan


Reply to this email directly or view it on GitHub: https://github.com/timheuer/callisto/issues/16#issuecomment-6142653

stefanolson commented 12 years ago

It seems absolutely instant to me, Unfortunately don't have anything slower than my machine to try it on, it doesn't appear slower than without it, but I get what you are saying. :-)

...Stefan

timheuer commented 12 years ago

Cool, having someone actually work with this is helpful. I think I'll be adding this concept to Callisto but partitioned for each control to minimize any perf issues.


http://timheuer.com/blog/ twitter: @timheuer

On Tue, Jun 5, 2012 at 10:03 PM, stefanolson < reply@reply.github.com

wrote:

It seems absolutely instant to me, Unfortunately don't have anything slower than my machine to try it on, it doesn't appear slower than without it, but I get what you are saying. :-)

...Stefan


Reply to this email directly or view it on GitHub: https://github.com/timheuer/callisto/issues/16#issuecomment-6143099

scottdorman commented 11 years ago

Any updates on this?

timheuer commented 11 years ago

Probably not going to so anything here. The only workable solution is retemplate the controls to what you need. My thought was that Callisto could provide inverted style definitions for you but I don't want to add unnecessarily add more xaml to parse for those who don't need it...degrading startup time.