WPF code for resources?

I am working on a wpf application, and until recently, I had a ResourceDictionary inside my main window resource for the xaml part. The resource dictionary contained a DataTemplate that was used to create multiple lists in the window. Xaml for this data table contained pointers to event handlers, for example:

<Button n:Name="btnClickMe" Content="Click Me!" LeftMouseButtonUp="btnClickMe_Click" />

Recently, I decided to split the contents of the window into separate user controls and transfer my ResourceDictionary to its own file. But, of course, there is no code file for the resource dictionary file. How can I connect this, with a breakdown of things, as I described?

Thanks in advance!

+3
source share
3 answers

- ResourceDictionary; , . , ResourceDictionary, AppStyles.xaml, XAML :

x:Class="Client.App.Shell.themes.AppStyles"

, AppStyles.xaml.cs, , :

namespace Client.App.Shell.themes
{
    public partial class AppStyles
    ...
+3

, , .cs, Visual Studio , .

, Buttons.xaml, Buttons.xaml.cs.

+1

Source: https://habr.com/ru/post/1706757/


All Articles