wpf

Design-time Error finding the Resource Dictionary - Inconsistent between projects

旧城冷巷雨未停 提交于 2021-02-18 20:59:16
问题 TLDR; Screens newly referencing an external ResourceDictionary file in VS2015 style correctly at run-time, but not at design-time. What gives? At work, we have a WinForms product which houses many WinForms screens with one developer actively adding new ones, as well as a handful of WPF screens with me adding new ones. Noticing a lot repetitious code/styling in existing WPF screens, I created a single project to house this - to be referenced by all existing/future WPF screens. Project:

Broken tab navigation in popup with WPF user control hosted inside Winforms in default AppDomain

主宰稳场 提交于 2021-02-18 19:54:22
问题 I have a WPF user control that uses a Popup. This control is a plugin and can be loaded in the main AppDomain or in a separate AppDomain, and it is hosted in a Winforms form using ElementHost. When the plugin is loaded in the main AppDomain, and the popup is opened, tabbing between the fields of the popup instead moves focus to the first control of the popup windows parent. When it is loaded in a new AppDomain, the tab behavior works as expected/desired (it cycles through the controls in the

Broken tab navigation in popup with WPF user control hosted inside Winforms in default AppDomain

巧了我就是萌 提交于 2021-02-18 19:53:13
问题 I have a WPF user control that uses a Popup. This control is a plugin and can be loaded in the main AppDomain or in a separate AppDomain, and it is hosted in a Winforms form using ElementHost. When the plugin is loaded in the main AppDomain, and the popup is opened, tabbing between the fields of the popup instead moves focus to the first control of the popup windows parent. When it is loaded in a new AppDomain, the tab behavior works as expected/desired (it cycles through the controls in the

MVVM Best Practices: communication between view models

走远了吗. 提交于 2021-02-18 17:56:43
问题 My simplified program structure looks like this: public class Manager { public Item MyItem { get; set; } public void Recalculate(){ ... } } public class Item { public string SomeProperty { get; set; } } public class ManagerViewModel { public Manager Model { get; set; } public ItemViewModel MyItem { get; set; } } public class ItemViewModel { public Item Model { get; set; } public string SomeProperty { get => Model.SomeProperty; set { Model.SomeProperty = value; RaisePropertyChanged(

MVVM Best Practices: communication between view models

情到浓时终转凉″ 提交于 2021-02-18 17:56:27
问题 My simplified program structure looks like this: public class Manager { public Item MyItem { get; set; } public void Recalculate(){ ... } } public class Item { public string SomeProperty { get; set; } } public class ManagerViewModel { public Manager Model { get; set; } public ItemViewModel MyItem { get; set; } } public class ItemViewModel { public Item Model { get; set; } public string SomeProperty { get => Model.SomeProperty; set { Model.SomeProperty = value; RaisePropertyChanged(

Can i call a function via DataTrigger (XAML)?

浪尽此生 提交于 2021-02-18 17:08:23
问题 I have a function in .xaml.cs which i wanted to call: .xaml.cs private void treeView_SelectedItemChanged(object sender, EventArgs e) { //treeView.ScrollToCenterOfView(sender as TreeViewItem); } like from this post: Make ListView.ScrollIntoView Scroll the Item into the Center of the ListView (C#) Answer 1 But i dont use the SelectedItem, my approach would be like: XAML: <Style.Triggers> <DataTrigger Binding="{Binding Path=IsActive}" Value="true"> // ###call this function </DataTrigger> </Style

Change system language for one/active window in WPF

限于喜欢 提交于 2021-02-18 12:47:14
问题 Is there a posibility to change system language only for one window in WPF? I know about InputLanguageManager but I assume that it changes language in whole system. 回答1: InputLanguageManager does exactly what you are asking for. It changes the keyboard layout for the current application. The keyboard layout is kept by the OS for each running application. Eg. if you open Notepad and switch to Russian, the open IE and switch to English, when you activate the Notepad application, your keyboard

Asynchronous Google File Upload with Progress Bar WPF

时光总嘲笑我的痴心妄想 提交于 2021-02-18 12:36:06
问题 I am uploading to Google Cloud Storage using a service account. I need to be able to display the progress of the upload in the WPF UI. Now, Whenever I try to update the ProgressBar.Value, it's not working, but when I just have the bytesSent written in Console, I can see the progress. public async Task<bool> UploadToGoogleCloudStorage(string bucketName, string token, string filePath, string contentType) { var newObject = new Google.Apis.Storage.v1.Data.Object() { Bucket = bucketName, Name =

WPF designer issues : XDG0008 The name “NumericTextBoxConvertor” does not exist in the namespace “clr-namespace:PulserTester.Convertors”

守給你的承諾、 提交于 2021-02-18 09:53:09
问题 I have an error that not let me see my designer.. but I have no error on a build and my program runs fine with no problem I have tried to: Clean and Rebuild Update Visual Studio Repair Visual Studio Restart my pc Nothing helped. I have no idea what more I can to do to solve it. I have to try to see in here and not worked for me even after restarted visual studio, re-built the solution the name <...> does not exist in the namespace clr-namespace <...> this is my Error: this is Xaml file:

Caliburn Micro Guard Methods not evaluating on property change

这一生的挚爱 提交于 2021-02-18 09:04:44
问题 I've been playing with the Caliburn Micro MVVM framework and am having some problems with guard methods. I have a view model: public class MyViewModel : PropertyChangedBase, IMyViewModel A property: public DateTime? Date { get{return this.date; } set { this.date = value; this.NotifyOfPropertyChange(() => Date); } } Also, i have a method in my view model with a guard method public void Calculate() { // ..some code.. } public bool CanCalculate() { return this.Date.HasValue; } And a button in my