Advice on design to handle server connection
Hello I am trying to work out how to include in the design of my WPF, C#, EF6, MVVM App code to handle a case if its SQL database is moved to a new server for example. Can one code for this situation so App can trap exception then allow a new server…
WPF DependencyProperty Not Working with .Net Core
For years, I have had the benefit of using code from an excellent Code Project article submitted by David Veeneman. You can view the article and download the code at https://www.codeproject.com/Articles/49802/Create-a-WPF-Custom-Control-Part-2. …
Generic ICommand error
I've these ICommand: public ICommand Add { get; set; } public ICommand Remove { get; set; } initialized this way: Add = new Command<Item>(add, (o) => true); Remove = new Command<IEnumerable<Item>>(remove, (o) => true); when…
Font Dialog not returning exact font size
i am working with font dialog from my winform project. if (fontDlg.ShowDialog() == DialogResult.OK) { FontName = fontDlg.Font.Name; FontStyle = fontDlg.Font.Style.ToString(); …
![](https://techprofile.blob.core.windows.net/images/JiX-lf2_BgAAAAAAAAAAAA.png?8D8532)
How to avoid crash multi projects application
Hi All. I have multi projects WPF application. I understand how to prevent the crash if error become in UI layer. But how to create message and inform a user if error happens in data layer? How to send a message on a screen if try-catch block catch an…
![](https://techprofile.blob.core.windows.net/images/-cMQHARdAE--M0ay3o3E7g.png?8D90C1)
How to set default font settings when opening font dialog
This is my code and this way i am opening font dialog. how could i open font dialog with default font settings? i want to set Font Name, Font Style, Font Size and underline etc when opening font dialog. if (fontDlg.ShowDialog() == DialogResult.OK) …
I need some help diagnosing an SEHException: External component has thrown an exception
This is a Windows Forms application using VB.Net and VS2012. It connects to an Access database with an oledbconnection and the 2013 Access Runtime. (It also connects with the corresponding SQLconnection to SQL Server without the problem below). The app…
ioexeption
hi i want the reason of this exeption, i spent hours but i didn't find the reason, visual studio 2019Version 16.6.4, wpf .net core3.1 application. thanks in advance.
How to make IcollectionView's Filter generic?
I've an ICollectionView wrapped in a Class<T>: public class CollectionView<T> : ICollectionView { ... ICollectionView view; public CollectionView(Collection<T> source) { ... view =…
How to apply animation on ListBoxItem before removal?
I've a Custom Control EditListBox: public class EditListBox : ListBox { static EditListBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(EditListBox), new FrameworkPropertyMetadata(typeof(EditListBox))); } protected…
Windows Forms, C# and/or VB - using .NET
Hi! I would like to use the .NET framework either with C# or VB creating a Windows Forms application. The underlying database is a Microsoft SQL server. New to Microsoft, but I would like to use the capabilites of the .NET framework - like OO etc. …
![](https://techprofile.blob.core.windows.net/images/7ca689de67ca4855a0ed985ff5add70e.png)
log4net in WPF application
Hi All. I'm trying to log exceptions in wpf application. For that I installed log4net package and modified app.config file <configSections> <section name="log4net"…
![](https://techprofile.blob.core.windows.net/images/-cMQHARdAE--M0ay3o3E7g.png?8D90C1)
WPF: how to enable DataGrid ID cells in first column editable when highlight it from code?
Our application is WPF application. In a page, there are two controls. One control is WPF DataGrid which include 5 columns. Only first and last columns are editable. First column represent ID. Fifth column represents comment. DataGrid includes 96…
This operation returned because the timeout period expired. (Exception from HRESULT: 0x800705B4)
While executing following code exception occurred at production environment. CompilerResults cr = provider.CompileAssemblyFromSource(cp, code.ToString()); Exception Details:- Message: This operation returned because the timeout period…
Dynamic Web Service Invocation using Aync Method
Hello, I am trying to implement a class library that I can use to dynamically invoke Web Services. I have built the following code from samples that I have found on the web: using System; using System.Collections.Generic; using System.Linq;…
winform + dotnet core 3.1 + xamarin(skiasharp) is it ok?
env: winform + dotnet core 3.1 I want to implement touch events, etc. using xamarin.forms (skiasharp). Drawing a simple shape in skcontrol succeeded. I'm curious if it's okay to implement the touch event listed in the demo project. I am curious…
Can't find XML files in published C# project
So I have created a Windows Forms app in C# using Visual Studio. The app saves data to .xml files in C:\Users\Me\source\repos\MyApp\MyApp\bin\Debug (default location), and works perfectly when building inside VS. My program uses simple LINQ…
WPF - Refreshing UI Problems with Serial.Datareceived
Hello, I am working on an HMI with WPF and arduino through Serial Port. Objectives (by now) are: Receive data of the sensors continuously. Send data to enable and disable pumps. Send data with the PH limits. UI must update…
![](https://techprofile.blob.core.windows.net/images/NhkrylFCqEiUzgd3au5ONw.png?8D7FAD)
How to construct NotifyCollectionChangedEventArgs for Multiple Replace and Remove
I've 3 ICommand Add, Remove and Replace. Add adds 3 items to the Collection: void add(object o) { var index = Items.Count; for (int i = 0; i < 3; i++) { Items.Add(new Item() { Id = ++count, …
How to make a GroupBox size to its content
Very simple request. How do I make (or can I make) a GroupBox size to its content. I have a groupbox which contains a number of items in a stackpanel. If I add a value then the GroupBox will not show the value. I have tried with height and width set…