benruehl / adonis-ui

Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
https://benruehl.github.io/adonis-ui/
MIT License
1.7k stars 143 forks source link

Layout is changed when enabling Adonis for switching between dark and light schemes #116

Closed McTopaz closed 3 years ago

McTopaz commented 3 years ago

I have a WPF-application where I have done all the steps to enable switching between dark and light themes.

When I add the boilerplate code of Adonis to be able to switch between dark and light schemes, the layout in my MainWindow is changed.

When I say "add the code to be able to switch between dark and light schemes"; I mean implementering the Introduction - Quick start steps in the documentation.

When the Quick start procedure is not implemented; my application looks like this: OK Layout

When I implement the Quick start procedure; my application looks like this: NOK Layout This picture show the light scheme. As that is the default scheme in my application.

The "blue section" in my application is my own UserControl. For some reason the layout of my UserControl has changed when enabling light or dark scheme.

The other controls in my application (a Button, a TextBox and a Groupbox) are also affected.

I have narrowed down to the boilerplate code in the App.xaml which cause the layout problems. Here is my App.xaml code. (Unfortunately I cannot seem to get the code well structured in with GitHub's code section regarding XML-code. You have to believe me that the code is the same as the boilerplate code example).

` <Application x:Class="Main.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Main" xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI" StartupUri="MainWindow.xaml">

` What could be the problem? I have attached my application: Application: [WPF.zip](https://github.com/benruehl/adonis-ui/files/5101539/WPF.zip) 1. Extract the Zip-file. 2. Open the WPF.sln file. 3. If needed, set the _Main project_ as the start up project of the solution. 4. Rebuild the solution 5. Run.
benruehl commented 3 years ago

Unfortunately, your solution raises a build error for me:

Could not load file or assembly 'file:///C:\<directory of the app>\WPF\packages\Fody.6.1.1\netclassictask\FodyIsolated.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

I tried

But nothing works.

So only by looking at your code I can say:

McTopaz commented 3 years ago

Strange about the PropertyChanged/Fody bug...

I'm now on a different computer and got it working without any problem by:

  1. Downloaded the WPF.zip.
  2. Extraxed the WPF-folder to the Window's desktop.,
  3. Opened the WPF.sln file.
  4. Rebuilt the ControlLibrary project.
  5. Rebuilt the Main project.
  6. Press Run.

I run:

This should run at your site as well. Strange...

McTopaz commented 3 years ago

Thanks for the tips anyway!

With that I managed to fix the appearance satisfactory.

benruehl commented 3 years ago

You're right, it's strange. I found a stackoverflow thread discussing the issue. The accepted answer suggests to not run the project on a network drive, but I don't even have one.

I'm glad your question is answered now, though. I will close this issue.