Questions tagged [resourcedictionary]
Provides a hash table / dictionary implementation that contains resources - reusable objects (e.g. vector drawings, brushes, colors, control template, data templates etc.) used by application components.
1,029
questions
1
vote
1
answer
27
views
MAUI: Unable to share ResourceDictionaries between two SDK-style projects
I have two SDK-style MAUI projects, let's say Project1 and Project2. Project2 has following structure:
Project2.sln
|
- Resources
|
- Colors.xaml
Colors.xaml has the following ...
1
vote
1
answer
53
views
How can I get access to a class backed resource dictionary instance?
I've got a resource dictionary with several control defined in it (TextBox and Button) that are unrelated to each other. I can access the controls via TryFindResource without problems.
Next, I wanted ...
0
votes
1
answer
23
views
Is there a way to assign a dynamic resource to a dependency property in code
I have a SolidColorBrush defined in a Resource Dictionary as follows:
<Color x:Key="ColorGray100">#F5F6F7</Color>
<SolidColorBrush x:Key="BrushGray100" Color=&...
0
votes
0
answers
34
views
Using relative path in WPF xaml file with pythonnet
I am currently working on an application using WPF + pythonnet. And I encountered a problem of using relative path in the main xaml file to find the ResourceDictionary file. Here is a minimal example. ...
0
votes
0
answers
36
views
Is it possible to reference the FontFamily key declared in one resource dictionary, in a FontFamily declaration in another resource dictionary
I have a resource dictionary file that contains Roboto fontfamily declarations, I'll call it Roboto.xaml . It declares a FontFamily key value of "RobotoLight". It has entries that appears ...
0
votes
1
answer
30
views
XmlParseException when using binding in DataTemplate to access ressource with a non-string key
I have a DataTemplate in a style for ListViews.ScriptAdvised is an enumeration.
The error comes from the StackPanel background attribute because if I remove it then it works.
My objective here is to ...
1
vote
2
answers
38
views
How can I use StaticResources defined in App.xaml in other ResourceDictionaries?
I defined some StaticResource styles inside App.xaml to use it across the app:
<Application x:Class="TaskListApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/...
1
vote
0
answers
52
views
In a XAML ResourceDictionary, how create a reference to an IValueConverter that is a nested class?
Given a class that implements IValueConverter:
public class MyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
...
0
votes
1
answer
39
views
BitmapIconSource in a ResourceDictionary.ThemeDictionaries (UWP)
I would like to change the BitmapIcon of a NavigationViewItem depending on the current Windows theme.
I've added a ResourceDictionary.ThemeDictionaries to the MainPage like that:
<Page.Resources>...
0
votes
0
answers
25
views
Get datagrid selected items from a global resource context menu
I have a scenario where multiple DataGrid from different views use the same ContextMenu specified in a ResourceDictionary. The problem is that I need to retrieve the list of selected items from the ...
0
votes
1
answer
205
views
WPF TextBox with StaticResource for Style and Text-Binding to property at ViewModel
I stucked at followed issue since a few days, perhaps I have misunderstood something.
I create a ResourceDictionary with stylesettings for textboxes and add it to App.xaml:
<ResourceDictionary ...
0
votes
0
answers
99
views
Xamarin XAML Intellisense doesn't work for styles from other assemblies
I wanted to separate my Xamarin app styling to a separate class library so it can be reused in other apps (light and dark theme, control styles, etc). However, the issue I'm running into is that when ...
0
votes
1
answer
38
views
Refer multiple Resource Dictionaries in the UWP project
My UWP app has a resource dictionary used for localization named "Resources.resx" and now I want to add another "ResourcesXaml.resx". I want to know how to access both files like ...
0
votes
1
answer
29
views
Is it possible to use WPF ResourceDictionary with parameters?
I have stored some icons as XAML-Code in the resourcedictionary, e.g.
<DataTemplate x:Key="Question">
<Viewbox Width="16" Height="16" xmlns="http://...
0
votes
0
answers
52
views
WPF Hyperlink control in static resource not firing events
I am populating a FlowDocumentScrollViewer with a FlowDocument out of a ResourceDictionary e.g.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
...
0
votes
1
answer
84
views
Swap DynamicResource in ResourceDictionary
I have an MVVM project with many ResourceDictionaries. I can already animate colour resources and dynamically change brushes. Updating works. Unfortunately, "relinking" a DynamicResource ...
0
votes
0
answers
40
views
DynamicResource not updating DependencyProperty of Freezable in ResourceDictionary
This is a hard one, I guess... Havn't found anything on this matter.
So, I have a SolidColorBrush defined in a ResourceDictionary. My app supports theming, so the brush resource can be replaced via
...
0
votes
0
answers
34
views
Attempting to set ElementHost.Child in the designer results in an immediate XamlParseException
I have a WPF control I am trying to use within a WinForms ElementHost control.
In the WinForms designer at the instant I select this control as the ElementHost.Child property, an error is shown like ...
0
votes
0
answers
283
views
WinUI 3 - UWP - How to programmatically add or remove resource dictionaries
In Xamarin Forms, you can interact with the Application.Current.Resources.MergedDictionaries by doing Add or Remove of a newed-up resource dictionary xaml file class
ResourceDictionary ...
0
votes
1
answer
303
views
WinUI 3 (UWP) Dynamic Theming
In Xamarin Forms, Styles and Colors can be changed dynamically by loading and unloading Resource Dictionaries from the Application.Current.Resources.MergedDictionaries. Can the same thing be done in ...
0
votes
0
answers
31
views
VB.Net WPF Resource Dictionary Trigger on PArent Element
I want to do a trigger on a Specific Element in ResourceDictionary.
I've a Checkbox in my MainWindow (DarkMode) if this checkbox is checked it should changed the Button color in all UserControls
like:
...
1
vote
0
answers
59
views
Problems with APP.XAML moved to .NET Core 5
I have a WPF application that is working just fine as written for .NET Framework targeting 4.7.2
There are several styles in the App.xaml file.
<BitmapImage x:Key="BitImageAdd" ...
0
votes
2
answers
111
views
Multiple XAML resource files in one assembly, referenced in another assembly
Good evening. A WPF XAML resource question please.
I have one user-control project called Resources. In this project I have a directory that contains multiple XAML files. I have merged these resources ...
0
votes
1
answer
120
views
Wpf ResourceDictionary for Style and Brushes and how to MergedDictionaries
I hope someone can clarify the situation I have below.
I have a simple CustomControl style based on a Button in a ResourceDictionary named SHButtonStyle.xaml
<Style TargetType="{x:Type local:...
0
votes
1
answer
127
views
Modify WPF resource at runtime, where resource is defined in a resource dictionary of shared dll
My WPF project references another project. In the referenced project, I have some colors and brushes defined in it.
Shared dll's resources:
<ResourceDictionary xmlns="http://schemas.microsoft....
0
votes
1
answer
61
views
Xamarin Forms Prism: prism A resource with the key 'Xamarin.Forms.NavigationPage' is already present in the ResourceDictionary
I have a Xamarin Forms 5.0 App using Prism 8. When I add the following into the ResourceDictionary:
<Style TargetType="{x:Type NavigationPage}">
<Setter Property="...
0
votes
0
answers
100
views
How to set "ResourceDictionary" as the content of the "Window" in WPF
I am trying to set a ResourceDictionary as the content of window in WPF. technically we can initialize a window with the corresponding view model. but when it comes to the output then the view is ...
0
votes
0
answers
55
views
Referencing a resource dictionary from another file in the project
I have a resource dictionary with one data template inside.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas....
0
votes
1
answer
128
views
Stand alone ResourceDictionary resource not found
I followed https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/resource-dictionaries#stand-alone-resource-dictionaries but i get the error.
XFC0124 Resource "ResourceDictionary1.xaml&...
1
vote
1
answer
102
views
How to make resource library support inteli-sense in wpf,like MahMetro or MaterialDesign Toolkit?
I am working on a complicate project which contains too much resources,custom controls and usercontrols.I extracted all resouces,such as brushes,images,styles...to a independend project. It works.In ...
0
votes
1
answer
421
views
how to bind a textbox that has an applied style in wpf
I style my TextBox using a ResourceDictionary (and have registered it in App.xaml):
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
...
0
votes
2
answers
104
views
WPF C# change resource dictionary accent color in code
i have a TextBox enter image description here
The textbox highlights when selected, & uses the accent color from the resource dictionary in app.xaml
<ResourceDictionary Source=&...
0
votes
1
answer
51
views
How to set SelectedItem to ListViewItem from its child
Is there an easy way to set the SelectedItem of my ListView when the TextBox gets the focus by Tab navigation?
AdditionalInformation.xaml:
<ListView Grid.Row="2" ItemsSource="{...
0
votes
1
answer
63
views
Empty Password Property after customizing Passwordbox with ControlTemplate in ResourceDictionary
I've customized my projects TextBox via a ResourceDictionary.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://...
-1
votes
2
answers
426
views
Why can't I use my static resource in a resource dictionary in wpf?
I designed my control (radio button) using a ResourceDictionary like this:
//in SidebarMenuButtonTheme.xaml
<Style TargetType="{x:Type custom:MenuItem}"
x:Key="...
0
votes
2
answers
120
views
Is it possible to replace/modify Implicit style at run time xamarin forms
I have the need to replace at runtime an implicit style that is located in a merged resource dictionary
for example lets suppose I have
<Style TargetType="Label">
<Setter ...
0
votes
1
answer
56
views
How do you get a MergedDictionary xamarin forms?
Hi I need to modify at runtime a mergedDictionary.
I have
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<themes:LightTheme />
<...
0
votes
1
answer
41
views
Merging ResourceDictionaries changing custom control pathing
Net 5 WFP app issue VS v.16.9
My custom control, which is supposed to display a plain isn't displaying at run. I think I got an idea what's going on but don't know how to fix it.
Merging resource ...
-1
votes
1
answer
121
views
WPF CollectionViewSource in ResourceDictionary
I've CollectionViewSource in ResourceDictionary file.
MenuItems.xaml
<!--This code is not working-->
<CollectionViewSource Source="{Binding DynamicMenuItems, RelativeSource={...
0
votes
1
answer
88
views
WPF style triggered in ResourceDictionary applied to all instances?
In my WPF project, I have defined a custom style for my Button with the key 'MainButton_1'.
The style includes a MouseEnter EventTrigger in the ControlTemplate, which gives the button a darker ...
0
votes
1
answer
215
views
Xamarin: Is it possible to include my font recources in the App.cs file?
Hi my current xamarin app does not have a global App.xaml file only an App.cs, this is the way I configured it and would like to keep it that way.
Now to the issue, I would like to use some font icons ...
1
vote
0
answers
36
views
how to get data from resx file and put in xlf file in angilar
I have resx file which is in data value format. and I need to get this value and put it in xlf file on basis of data.
Resx file format
<data name="familyMembersTravelling" xml:space=&...
0
votes
1
answer
136
views
How can I merge two ResourceDictionary objects into Application.Current.Resources using C# instead of XAML?
Here is the situation that I have. Two resource dictionaries labeled for this example Theme1 and Theme2
public class Theme1 : ResourceDictionary
{
protected Theme1()
{
Add(nameof(...
0
votes
1
answer
92
views
How to have multiple styles of buttons in ResourceDictionary.MergedDictionaries
Alright, so I am pretty new to WPF and I've tasked myself with a pretty hard challenge. I'm trying to make a program for the company I work for. I've already designed the Login Window and now, I'd ...
0
votes
2
answers
367
views
Error message design time only: "Cannot locate resource 'styles/buttonstyles.xaml'"
A mysterious message comes up in the following scenario:
Cannot locate resource 'styles/buttonstyles.xaml'
This message only appears in design mode, and cannot be get ridden of. If I rebuild the ...
0
votes
1
answer
331
views
WPF override key in resource dictionary with C#
I have a wpf-application with a resource dictionary like this:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://...
0
votes
0
answers
150
views
Resource dictionary resolved in one project but not another in same solution
I created a resource dictionary (Style.xaml) and put it in it's own assembly (ResourceSharing.dll).
I then have a solution with two projects. In both projects, I added a reference to ResourceSharing....
0
votes
1
answer
322
views
WPF How to give multiple resource dictionaries the same class?
I'm not sure if I'm asking the right type of question, but here's my issue.
I have multiple resource dictionaries, and I would like to allow for users to customise these resource dictionaries to ...
0
votes
2
answers
263
views
UWP Style X:binding of margin to a function throws a System.AccessViolationException. Any ideas why, when this works fine if set in inline xaml?
I have some methods that I x:bind to, to set element size based on the size of the host control. All works well except when binding a function to the Margin property in my user control (from style ...