Я делаю игровой движок и кодирую новый пользовательский интерфейс, и он выдает следующую ошибку: «Ошибка XDG0062« StaticResourceExtension »недействительна для Setter.Value. Единственными поддерживаемыми типами MarkupExtension являются DynamicResourceExtension и BindingBase или производные типы».
Вот единственный код, который был добавлен с момента последней рабочей сборки
ControlTemplate.xaml
<ResourceDictionary x:Class = "Pico_Editor.Dictionaries.ControlTemplates"
xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local = "clr-namespace:Pico_Editor.Dictionaries">
<Style TargetType = "{x:Type TextBox}" x:Key = "TextBoxStyle">
<!-- TODO: define the look of textbox here -->
</Style>
<Style TargetType = "{x:Type TextBox}" x:Key = "{x:Type TextBox}" BasedOn = "{StaticResource TextBoxStyle}">
<EventSetter Event = "KeyDown" Handler = "OnTextBox_KeyDown"/>
</Style>
<Style x:Key = "PicoWindowStyle" TargetType = "{x:Type Window}">
<Setter Property = "BorderBrush" Value = "{StaticResource Editor.Selected.BackgroundBrush}"/>
<Setter Property = "Background" Value = "{StaticResource Editor.Window.GrayBrush1}"/>
</Style>
</ResourceDictionary>
EditorColors.xaml
<ResourceDictionary xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local = "clr-namespace:Pico_Editor.Dictionaries">
<!-- Editor Colors -->
<Color x:Key = "Editor.Window.GrayColor1"> #ff1f1f1f</Color>
<Color x:Key = "Editor.Window.GrayColor2"> #ff262626</Color>
<Color x:Key = "Editor.Window.GrayColor3"> #ff313131</Color>
<Color x:Key = "Editor.Window.GrayColor4"> #ff404040</Color>
<Color x:Key = "Editor.Window.GrayColor5"> #ff535353</Color>
<Color x:Key = "Editor.Window.GrayColor6"> #ff6a6a6a</Color>
<Color x:Key = "Editor.Disabled.FontColor"> #ff868686</Color>
<Color x:Key = "Editor.FontColor"> #ffdddddd</Color>
<Color x:Key = "Editor.RedColor"> #ffff5a6a</Color>
<Color x:Key = "Editor.GreenColor"> #ff90ee90</Color>
<Color x:Key = "Editor.BlueColor"> #ff80deff</Color>
<Color x:Key = "Editor.OrangeColor"> #ffffd067</Color>
<Color x:Key = "Editor.Selected.BackgroundColor"> #ff3c67b6</Color>
<!-- Editor Brushes -->
<SolidColorBrush Color = "{StaticResource Editor.Window.GrayColor1}" x:Key = "Editor.Window.GrayBrush1"/>
<SolidColorBrush Color = "{StaticResource Editor.Window.GrayColor2}" x:Key = "Editor.Window.GrayBrush2"/>
<SolidColorBrush Color = "{StaticResource Editor.Window.GrayColor3}" x:Key = "Editor.Window.GrayBrush3"/>
<SolidColorBrush Color = "{StaticResource Editor.Window.GrayColor4}" x:Key = "Editor.Window.GrayBrush4"/>
<SolidColorBrush Color = "{StaticResource Editor.Window.GrayColor5}" x:Key = "Editor.Window.GrayBrush5"/>
<SolidColorBrush Color = "{StaticResource Editor.Window.GrayColor6}" x:Key = "Editor.Window.GrayBrush6"/>
<SolidColorBrush Color = "{StaticResource Editor.Disabled.FontColor}" x:Key = "Editor.Disabled.FontBrush"/>
<SolidColorBrush Color = "{StaticResource Editor.FontColor}" x:Key = "Editor.FontBrush"/>
<SolidColorBrush Color = "{StaticResource Editor.RedColor}" x:Key = "Editor.RedBrush"/>
<SolidColorBrush Color = "{StaticResource Editor.GreenColor}" x:Key = "Editor.GreenBrush"/>
<SolidColorBrush Color = "{StaticResource Editor.BlueColor}" x:Key = "Editor.BlueBrush"/>
<SolidColorBrush Color = "{StaticResource Editor.OrangeColor}" x:Key = "Editor.OrangeBrush"/>
<SolidColorBrush Color = "{StaticResource Editor.Selected.BackgroundColor}" x:Key = "Editor.Selected.BackgroundBrush"/>
</ResourceDictionary>
Я также добавил Style = "{StaticResource PicoWindowStyle}" в раздел окна моего главного окна.
Любая помощь будет оценена по достоинству. Я понятия не имею, в чем проблема, и я не вижу ничего плохого в коде.
Вы видели это?: stackoverflow.com/questions/59052601/…





Я забыл, что xaml имеет поток кода сверху вниз, и мой файл App.xalm
<ResourceDictionary Source = "pack://application:,,,/Dictionaries/ControlTemplates.xaml"/>
на вершине
<ResourceDictionary Source = "pack://application:,,,/Dictionaries/EditorColors.xaml"/> а должно было быть наоборот
Я забыл, что xaml имеет поток кода сверху вниз, а в моем файле App.xalm
<ResourceDictionary Source = "pack://application:,,,/Dictionaries/ControlTemplates.xaml"/>поверх<ResourceDictionary Source = "pack://application:,,,/Dictionaries/EditorColors.xaml"/>, но должно было быть наоборот