Wpf ListView right border cut off

I tried to create WPF list View with 3 textlines but the right border is not set correctly (cut off by around 1-3 pixel right border. The left hand side is fine. <Window x:Class="ListViewBorder.MainWindow" xmlns="http://schemas.microsoft.com/...
more »

2017-05-14 19:05 (1) Answers

Custom Caption Buttons in WPF

I am creating a custom window style in WPF. So far, I have been able to accomplish something that almost works, in pure XAML. <ControlTemplate TargetType="{x:Type Window}"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThick...
more »

2017-05-14 11:05 (1) Answers

Can't change DataContext WPF

I am trying to use a MVVM pattern instead of putting all logic in the code-behind file, but I can't seem to get it working. My view is this: <Window x:Class="WpfApp4.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentatio...
more »

2017-05-14 11:05 (1) Answers

Embedding Unity in WPF with -parentHWND

I am fairly new with WPF and am trying to recreate the function of the EmbeddedWindow example from the unity docs, that explain how to launch a standalone unity window inside a WPF window using the commandline and -parentHWND. the example uses this ...
more »

2017-05-13 19:05 (0) Answers

WPF async await

I'm trying to use async click event: private async void Button_Click(object sender, RoutedEventArgs e) { MessageBox.Show(Thread.CurrentThread.ManagedThreadId + " click_begin"); await changeProgressBarAsync(ProgresBar_mainLoad); Message...
more »

2017-05-13 12:05 (1) Answers

WPF MVVM DataGrid Navigation

I'd like ask for help with this problem. My goal is prepare navigation control for datagrid same like in WinForms. Move top, move one row down, one row up, move bottom and possibility jump to row (by number). I make some solution xaml: <...
more »

2017-05-12 08:05 (0) Answers

Sort List using Filename

i have a program where i need to list the files in my Listbox like the way windows Sort the files i have this code but it doesn't sort the Files properly public ObservableCollection<string> FileNames { get; } = new ObservableCollection<st...
more »

2017-05-12 01:05 (1) Answers

Pause a window like MessageBox.Show()

I have a scripting language implemented in WPF that allows a user to script multiple concurrent actions. These actions are implemented using async/await and all of them run on the main thread. I'm now introducing a step debugger into this script lan...
more »

2017-05-11 19:05 (1) Answers

How to get HTML from WebBrowser control

There are loads of posts similar to this. How to get rendered html (processed by Javascript) in WebBrowser control? suggests to use something like webBrowser1.Document.GetElementsByTagName("HTML")[0].OuterHtml; Document is treated as an object, I...
more »

2017-05-11 10:05 (1) Answers

Accessing style elements

I have a slider style (cut version) <Style x:Key="SliderThumb" TargetType="Thumb"> <Setter Property="SnapsToDevicePixels" Value="true" /> <Setter Property="OverridesDefaultStyle" Value="true" /> <Setter Property="Tem...
more »

2017-05-11 04:05 (1) Answers

Make a custom WPF Control Designer friendly

I created a custom control (by extending System.Windows.Control.Control) and styled it with Generic.xaml This works well but the only way i have found so far to get it designer friendly is to add the ContentPropertyAttribute to specify which propert...
more »

2017-05-10 20:05 (0) Answers

Weak event + lambda = memory leakage?

Playing with weak event public class Test { public Test(Button button) { WeakEventManager<Button, RoutedEventArgs>.AddHandler(button, nameof(Button.Click), (s, e) => MessageBox.Show("Tada")); } } with this ...
more »

2017-05-10 14:05 (0) Answers

Listbox is not Populating using binding

I am trying to convert my existing program in c# wpf, using mvvm pattern. The first part is select the Folder location of the files to be process and populate the listbox I found an example here using Mvvm Light http://stackoverflow.com/questions/...
more »

2017-05-10 08:05 (1) Answers

Show a Window while application is closing

I've a very heavy application that takes some time to close itself (it also depends on the pc where it is running.. but this is not the matter right now) I would like to show a custom window with a message during this closing time, but as soon as i ...
more »

2017-05-09 17:05 (3) Answers