Closed julianpoelmann closed 1 year ago
What is in your app.xaml?
<Application x:Class="KoalaBound.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:KoalaBound"
xmlns:mica="clr-namespace:MicaWPF.Styles;assembly=MicaWPF"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<mica:ThemeDictionary Theme="Auto" />
<!-- And Here (You can change to Light or Dark here) -->
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
I will change the docs to reflect this since it is in the getting started with controls but is now nescessary since starting the AccentColorService from ThemeService was causing issues at startup.
Add the
<Application x:Class="KoalaBound.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:KoalaBound"
xmlns:mica="clr-namespace:MicaWPF.Styles;assembly=MicaWPF"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<mica:ThemeDictionary Theme="Auto" />
<!-- And Here (You can change to Light or Dark here) -->
<mica:ControlsDictionary /> <!-- Here -->
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
Fixed the documentation to reflect the change. Changed the README and the Getting started section of the wiki.
Eyy nice, I'll try this after work. Also thanks for the quick replies!
same exact error. in the screenshot it doesnt show the winrt error its giving but it does in the text log i sent
Do you use Net5.0+?
If yes your csproj file needs to be modified and those lines needs to be modified/added
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>7.0</TargetPlatformMinVersion>
Because it does use winrt for communication with UWP for color accuracy.
im using net6 and did it like this
<TargetFramework>net6.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>6.0</TargetPlatformMinVersion>
im on 11, the build number in your message instantly results in an error. the one i put in is from a list it showed me with the ones that should work.
i tried making it 7 but it returns the same error
i tried it in a fresh net7 project and the same issue appears
Zip and send the project I will test on my side
alrighty. do you prefer gdrive or megasync?
Gdrive, but any is fine.
https://drive.google.com/file/d/1D10OQwss-JGa-fGc21gvroBQb0Qow0Pc/view?usp=sharing
The file you sent I modified the csproj to these then it runs fine
Here is my windows build:
I would recommend upgrading Windows to 22H2 and try again as Windows 22000 the original version I was using an undocumented API they might have retired it in the lastest versions.
I will spin up a VM of version 22000 and try.
i cannot upgrade to 22h2 due to compatibility issues with the windows 10 explorer (im using a tweak that lets me have the windows 10 taskbar and explorer on windows 11) .
also im currently building on netcore3.1 and that works. might have to apply this tho as im trying to integrate depotdownloader which requires net6+.
also i have another question, how can i make a button opaque? i tried to find a checkbox for it or chaning the brushes but it remains
i cannot upgrade to 22h2 due to compatibility issues with the windows 10 explorer (im using a tweak that lets me have the windows 10 taskbar and explorer on windows 11) .
also im currently building on netcore3.1 and that works. might have to apply this tho as im trying to integrate depotdownloader which requires net6+.
also i have another question, how can i make a button opaque? i tried to find a checkbox for it or chaning the brushes but it remains
I will never understand the peoples upgrading to 11 that want things to look like 10 (Shrug). For the button if you want to use the Accent colored one you can use this style: MicaWPF.Styles.AccentedButton
To customize the color you can change the color in the ThemeService (It will use the accent color of Windows by default): https://github.com/Simnico99/MicaWPF/wiki/Change-Theme-or-Accent-color#updateaccentscolor
And I think I know why .Net6 + doesn't work because of a dll in C++ linked with WinRT that I use, .Net Framework and netcore doesn't need it as it was integrated to it.
i prefer the style of the older bar and its a lil more compact.
im having trouble applying the button style (im very new to wpf, im used to winforms). also i had the same issue with net 7, it is the winrt issue. id prefer not to use net framework as it kinda always messes up the way i update my applications
i prefer the style of the older bar and its a lil more compact.
im having trouble applying the button style (im very new to wpf, im used to winforms). also i had the same issue with net 7, it is the winrt issue. id prefer not to use net framework as it kinda always messes up the way i update my applications
I will fire up my VM this week end and take a look I wrote net6+ (Because + means Net7 and Net8 and future ones)
Here is sample code for the button:
<controls:Button Style="{StaticResource MicaWPF.Styles.AccentedButton}">
I am an accented button
</controls:Button>
Try changing staticressource to DynamicResource
no difference
Ah wait It might show an error in the IDE but if you run it it should work fine
your right but it does show up strangely
your right but it does show up strangely
Ah add a height
<controls:Button Style="{StaticResource MicaWPF.Styles.AccentedButton}" Height="45">
I am an accented button
</controls:Button>
it already has height but i do notice it lacks width. i added width but it still looks the same.
also i do not see the usual option to suppress the error the ide is giving about the style
it already has height but i do notice it lacks width. i added width but it still looks the same.
also i do not see the usual option to suppress the error the ide is giving about the style
Add a slight margin like (Adjust as needed)
<controls:Button Style="{StaticResource MicaWPF.Styles.AccentedButton}" Height="45" margin="2">
I am an accented button
</controls:Button>
Also for the IDE sometimes it needs a restart to work properly I know Visual studio 2019/2022 is a bit finicky with WPF and sometimes fucks up big time.
it also already has a margin, the margin keeps it in its place-
also oof ill restart it then
Humm weird my exemple code works well on my side
<controls:MicaWindow
x:Class="MicaWPF.Test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:MicaWPF.Controls;assembly=MicaWPF"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Width="800"
Height="450"
d:Background="{DynamicResource MicaWPF.Brushes.ApplicationBackground}"
TitleBarType="WinUI"
mc:Ignorable="d">
<Grid >
<controls:Button Style="{StaticResource MicaWPF.Styles.AccentedButton}" VerticalAlignment="Top" Height="45" Margin="5" >
I am an accented button
</controls:Button>
</Grid>
</controls:MicaWindow>
Normally it looks like yours if the border is actually cut off by something that is why I asked for the margin
this is basically my buttons
<controls:Button x:Name="StartGameButton" Style="{DynamicResource MicaWPF.Styles.AccentedButton}" Content="Start" Margin="194,327,460,0" VerticalAlignment="Top" Height="50" FontFamily="Starbound Font" MouseEnter="StartGameButton_MouseEnter" Click="StartGameButton_Click" ClipToBounds="True" IsDefault="True"/>
ClipToBounds="True" is removing the border
that fixed it, i had it enabled because for some reason at runtime the font i use loses like an entire line of pixels, i thought that cliptobounds would fix it
also the xaml designer crashes constantly when loading properties of mainly the grid and the window. sometimes it works but now its stuck crashing all the time
Fixed with version 6.0.0 Use the MicaWPF.Lite package.
ive followed this step by step. had issues with the .net target framework but they seem to have dissapeared but now i have a missing file error.
I expected it to work
Windows 11 11 Pro N for Workstations Build 22000.1696 .Net 6.0