How to add more resources to a UserControl

Can we add new resources to a UserControl at the point of usage, without wiping out the resources that UserControl has defined itself? So for exmaple, here is a UserControl: <UserControl x:Class="MyControl"> <UserControl.Resources> ...
more »

2017-03-18 12:03 (1) Answers

Using enum value in XAML

I have defined an enum in C# public enum PointerStyle { Pointer, Block, Slider } ; I am using it as a dependency property on a WPF custom control public static DependencyProperty DisplayStyleProperty = DependencyProperty.Register("Displ...
more »

2017-03-18 11:03 (1) Answers

TreeViewItem With Stretch

I want to create a WPF TreeView that contains TreeViewItems that stretch to fill the available space. I modified the TreeViewItem template using this as a guide:
more »

2017-03-18 00:03 (1) Answers

C# WPF - DataGridComboBoxColumn ItemsSource

I'm currently struggling with DataGridComboBoxColumn in C# WPF. I have the class ToolModel class ToolModel { public long Id { get; set; } public string Number { get; set; } public string Name { get; set; } public string Coating { ...
more »

2017-03-17 20:03 (1) Answers

Redefining color values in consumer projects

What is the correct way of overriding color resources defined in WPF Controls Library project? Say I have project A that is a WPF Controls Library having the following two color resources defined: <Color x:Key="Color1">WhiteSmoke</Color>...
more »

2017-03-17 14:03 (0) Answers

WPF DataGrid shows dot instead comma

After digging on the internet and searching for answers without result, I would like to ask you for help. I have a SQL database table with 2 columns (float datatype e.g 1,2 1,3 1,4 etc.) which are bound to a DataGrid . XAML code: <Collect...
more »

2017-03-17 14:03 (1) Answers

Datatrigger if string contains certain characters

im struggling with figuring out how to check if a string contains certain characters / words and make the datatriggers go off based on that. In my example below I would like the datatrigger to go off when there is a color in the value, and what com...
more »

2017-03-16 19:03 (1) Answers

OutOfMemory exception with BitmapSource in WPF app

Task: I got 2 monitors. And I need to show on #1 what is going on #2. In another words, first monitor is nothing but a reflector of second. Current solution: Just making screenshot every ~100ms and re-render. Following method is responsible for cap...
more »

2017-03-16 10:03 (1) Answers

WPF Binding to combobox

I have list of Tabs where Tab is: public class Tab { public int Id {get; set;} public string Name {get; set} public List<country> Country {get; set;} } Now, I want to bind it to two comboboxes: First combobox is ok, but at second I ...
more »

2017-03-15 12:03 (1) Answers

Sum Columns in ListView WPF

I have the below csv file: Name,Score Kelly,5 James,5 Sara,1 Kelly,4 James,1 John,3 And I am trying to read the CSV file, get the sum of the Scores based on the Names and load them into the listview. As a start, I was able to read the CSV file a...
more »

2017-03-15 11:03 (2) Answers

CefSharp - can't enable webgl

I'm initializing my Chromium Browser like this: CefSettings settings = new CefSettings(); settings.CommandLineArgsDisabled = false; settings.CefCommandLineArgs.Clear(); settings.CefCommandLineArgs.Add("enable-3d-apis", "1"); settings.CefCommandLineA...
more »

2017-03-14 18:03 (1) Answers

Filter ReactiveList on background thread

I have a collection of object which need filtering. The filter callback is time consuming so I need to run it on a background thread. I create a derived Reactive list with CreateDerivedCollection(..) _reactiveCollection = RawFileList.CreateDerivedCo...
more »

2017-03-14 17:03 (0) Answers