yotabit
yotabit
CC#
Created by yotabit on 10/25/2022 in #help
Integration Testing
I learned about the integration testing concept, but I'm having a hard time finding how people are using it. I use WPF and MVVM in my project. - Do you use Integration testing? If yes, how do you use it? - What are recommended tools to work with MVVM+WPF + tests? - Is there anything you'd like me to know before I start writing my integration tests?
10 replies
CC#
Created by yotabit on 9/17/2022 in #help
Style dependent on a property
A Button ConfirmationButton should have the Style= MahApps.Styles.Button.Dialogs.Accent when the boolean property CancellationVisible that I'm binding is True. The code below shows how I tried to do it, but the problem is that it shows this error: error MC3029: 'Style' member is not valid because it does not have a qualifying type name. How can I fix it or achieve the same behavior?
<Button x:Name="ConfirmationButton" >
<Button.Triggers>
<DataTrigger Binding="{Binding CancellationVisible}" Value="True">
<Setter Property="Style" Value="{StaticResource MahApps.Styles.Button.Dialogs.Accent}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button x:Name="ConfirmationButton" >
<Button.Triggers>
<DataTrigger Binding="{Binding CancellationVisible}" Value="True">
<Setter Property="Style" Value="{StaticResource MahApps.Styles.Button.Dialogs.Accent}" />
</DataTrigger>
</Button.Triggers>
</Button>
15 replies
CC#
Created by yotabit on 9/1/2022 in #help
Color brush from App.xaml
App.xaml has a ResourceDictionary that contains a SolidColorBrush. How can I get that SolidColorBrush from a different file .cs?
// App.xaml
<Application.Resources>
<ResourceDictionary x:Name="AppResourceDic">
<Color x:Key="Colors.MyOwnBlue">#002e5e</Color>
<ResourceDictionary>
<Application.Resources>

//MyColors.cs
var color = App.AppResourceDic(Colors.MyOwnBlue); // <--- how??
// App.xaml
<Application.Resources>
<ResourceDictionary x:Name="AppResourceDic">
<Color x:Key="Colors.MyOwnBlue">#002e5e</Color>
<ResourceDictionary>
<Application.Resources>

//MyColors.cs
var color = App.AppResourceDic(Colors.MyOwnBlue); // <--- how??
3 replies
CC#
Created by yotabit on 8/25/2022 in #help
Project Path
How can I get the Uri path to my project? What I get: D:\csharp\MyFirstProject\MyFirstProjectUI\bin\Debug\net6.0-windows\ What I want: D:\csharp\MyFirstProject\MyFirstProjectUI\Resources\ What I tried:
AppDomain.CurrentDomain.BaseDirectory.ToString();
Environment.CurrentDirectory;
AppDomain.CurrentDomain.BaseDirectory.ToString();
Environment.CurrentDirectory;
Resources is a folder I created. The root of my project - what I'm trying to get - is D:\csharp\MyFirstProject\MyFirstProjectUI\
12 replies