Click here to Skip to main content
15,903,613 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Draw Images Pin
Kevin Marois7-Apr-23 6:31
professionalKevin Marois7-Apr-23 6:31 
GeneralRe: Draw Images Pin
Pete O'Hanlon13-Apr-23 21:41
mvePete O'Hanlon13-Apr-23 21:41 
QuestionJson Based Themes Pin
Kevin Marois6-Mar-23 6:39
professionalKevin Marois6-Mar-23 6:39 
QuestionDropDown TreeView Pin
Kevin Marois22-Feb-23 18:34
professionalKevin Marois22-Feb-23 18:34 
AnswerRe: DropDown TreeView Pin
Gerry Schmitz24-Feb-23 9:08
mveGerry Schmitz24-Feb-23 9:08 
GeneralRe: DropDown TreeView Pin
Kevin Marois2-Mar-23 11:30
professionalKevin Marois2-Mar-23 11:30 
GeneralRe: DropDown TreeView Pin
Gerry Schmitz3-Mar-23 5:25
mveGerry Schmitz3-Mar-23 5:25 
QuestionStyles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma22-Feb-23 1:50
Simos Sigma22-Feb-23 1:50 
As the title says, I am facing an issue when the styles of a window element are coming from an external resource dictionary which is included into a .dll reference of my project. The problem is that styles aren't apply in design mode!!!

To be more specific...

I have create a (.NET 4.8 Framework) WPF control library project which, among other stuff, includes some resource dictionary (.xaml) files with styles. To use these styles into a (.NET 4.8 Framework) WPF application project, as far as I know, I can use two ways...

WAY ONE: ( [^]Example )
■ Into the solutions of my application project I add my control library as a new project.
■ I go into my application project and I add a reference that points to my control library project (.csproj) file.
■ I add the .xaml file from my control library project into the App.xaml file of my application project as merged dictionary.
■ And finally, I give the desired style to my window element.

Using way one it works fine, in design mode too, but what if, for various obvious reasons, I want to give my control library to someone as a .dll file? Then, as far as I know, I have to use the second way...

WAY TWO: ( [^]Example )
Without to add my control library as a new project into the solution of my application project, I go to my application project and I add a reference that points to the .dll file of my control library.
■ I add the .xaml file from my control library project into the App.xaml file of my application project as merged dictionary.
■ And finally, I give the desired style to my window element.

But, using way two, styles are applying only when I run the program and not in design mode!!! And this happens only for window elements!!! As you can see if you run the code of "Way Two" example, the grid gets the given style even in design mode. The problem is with the window element!!!

I made this question in Stackoverflow too and I got [^]this answer which doesn't work for me. [^]Here is an example code I tried based on above answer...

I also made the same question here, in Quick Answers section and I got [^]this answer which also doesn't work for me. [^]Here is an example code I tried based on above answer.

In both cases I still have the same problem. The styles of the window element are not applied in design mode!!!

Can someone help me to solve this issue please?

PS: I am working on Window 10 machine, using Visual Studio 2022 version 17.5.0 and my WPF projects based on .NET 4.8 Framework.

Thank you for your time!!!
Rant[REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Richard Deeming22-Feb-23 3:51
mveRichard Deeming22-Feb-23 3:51 
GeneralRe: [REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma22-Feb-23 22:16
Simos Sigma22-Feb-23 22:16 
GeneralRe: [REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma22-Feb-23 23:46
Simos Sigma22-Feb-23 23:46 
GeneralRe: [REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma23-Feb-23 0:55
Simos Sigma23-Feb-23 0:55 
QuestionWPF .Net Core 6 RelayCommand Problem Pin
Kevin Marois3-Feb-23 12:33
professionalKevin Marois3-Feb-23 12:33 
AnswerRe: WPF .Net Core 6 RelayCommand Problem Pin
Richard Deeming5-Feb-23 23:18
mveRichard Deeming5-Feb-23 23:18 
Questionhow to set the icon for output result(.exe) in vs2022 ? Pin
Member 136170031-Feb-23 14:56
Member 136170031-Feb-23 14:56 
AnswerRe: how to set the icon for output result(.exe) in vs2022 ? Pin
Richard MacCutchan1-Feb-23 21:12
mveRichard MacCutchan1-Feb-23 21:12 
GeneralRe: how to set the icon for output result(.exe) in vs2022 ? Pin
Member 136170032-Feb-23 13:43
Member 136170032-Feb-23 13:43 
QuestionExpander Width Problem Pin
Kevin Marois13-Jan-23 13:01
professionalKevin Marois13-Jan-23 13:01 
AnswerRe: Expander Width Problem Pin
Gerry Schmitz14-Jan-23 5:43
mveGerry Schmitz14-Jan-23 5:43 
QuestionTabItem Render Pin
Kevin Marois9-Jan-23 18:59
professionalKevin Marois9-Jan-23 18:59 
AnswerRe: TabItem Render Pin
Pete O'Hanlon9-Jan-23 19:38
mvePete O'Hanlon9-Jan-23 19:38 
GeneralRe: TabItem Render Pin
Kevin Marois9-Jan-23 20:07
professionalKevin Marois9-Jan-23 20:07 
GeneralRe: TabItem Render Pin
Pete O'Hanlon9-Jan-23 20:38
mvePete O'Hanlon9-Jan-23 20:38 
GeneralRe: TabItem Render Pin
Gerry Schmitz10-Jan-23 6:45
mveGerry Schmitz10-Jan-23 6:45 
QuestionWPF Custom Control & User Control Pin
Kevin Marois30-Dec-22 18:49
professionalKevin Marois30-Dec-22 18:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.