Most voted "wpf" questions
Windows Presentation Foundation, or WPF, is a subsystem for presenting user interfaces in Windows-based applications. It features a diverse set of controls, layout options, 2D and 3D graphics, media and text manipulation and allows data binding and model-oriented style.
Learn more…413 questions
Sort by count of
-
2
votes1
answer153
viewsAdd selected lines from Gridcontrol to Observablecollection
I am trying to add my grid items to my Observablecollection but I am unsuccessful. I have a column that has the Checkbox that I put through the property ShowCheckBoxSelectorColumn. I have the…
-
2
votes0
answers112
viewsEdit XML via Treeview WPF Node - C#
I have a question, I have a code that creates a Treeview dynamically through a code c#. A TreeView was created in WPF. My goal is to create a function that opens an item XML and created a TreeView,…
-
2
votes1
answer712
views -
2
votes1
answer220
viewsImage in WPF menu with C#
I have a problem, I created an application in WPF, and put a menu that will have images in the items. When I preview the image in VS is ok, but when I run the application the images do not appear.…
-
2
votes1
answer399
viewsCommunication between Forms
I have a form that has a text editing component(RichTextBox) and create a search form (Find/famous CTRL+F). My question is how do I make one form "chat" with the other. For example, type something…
-
2
votes1
answer266
viewsDoubt with Entityframework (Migration)
I’m trying to make my code run, but I’m not getting it because of this Error Severity Code Description Project File Line Error CS0311 The type…
-
2
votes1
answer159
viewsOutput of a method or event - C# / WPF
I am using a return to be able to leave the event textEstado_Validate. The problem is that when he leaves this event, he enters the textEstado_KeyDown. How can I make sure he doesn’t enter any other…
-
2
votes2
answers498
viewsI can’t run an animated gif on my WPF project
I downloaded a gif. link. The problem that the link gives a double click and works. Drag to my application and no longer works. The image appears, but stopped and not moving. I want to put this gif…
-
2
votes1
answer51
viewsAdding Radiobutton to the Datagrid in Runtime
At a certain point in the software, I need to populate a DataGrid in Runtime. I managed to perform this operation partially. My problem is that even if I insert RadioButton.Content, it simply does…
-
2
votes1
answer95
viewsPublish of WPF applications
I made a Publish of a WPF application with the CD-ROM option. Well, I noticed that it creates some folders, an Autorun.inf, a setup.exe and a Nome_Programa.Application. I was doing some tests,…
-
2
votes2
answers297
viewsWhat are the differences between Visibility.Hidden and Visibility.Collapsed?
What are the differences between the visibilities Visibility.Hidden and Visibility.Collapsed of the WPF? There are practical or theoretical differences between set the Height and the Width of a…
-
2
votes1
answer83
viewsHow to use an enumerator like Itemsource from a Combobox?
Assuming I have the following: enum Dias {Segunda, Terça, Quarta, Quinta, Sexta, Sábado, Domingo}; How can I use the enumerator Dias as ItemSource of a ComboBox in a WPF application? For example:…
-
2
votes1
answer31
viewsHow to create a Merged "Resourcedictionaries"
I have a small example where I created an application-level Resource: <Application x:Class="teste1.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"…
-
2
votes1
answer344
viewsHow to change the source of an image control from a Resourcedictionary
I have the next Resourcedictionary: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"…
-
2
votes1
answer54
viewsWhat are Staticresources and Dynamicresources in WPF?
When I use Resources in WPF, I can specify them as much as StaticResource, as DyanamicResource. However, most of the time only one works, and the other would initiate an exception. Starting from…
-
2
votes0
answers40
viewsWork with two treeviews and their WPF items
I have two similar treeviews, but with different items, in this case, one of them brings a dialogue in Portuguese while the other should bring the same dialogue in English. I have two text boxes,…
-
2
votes1
answer192
viewsHow to add properties to WPF components?
I can use as an example the System.Windows.Controls.TextBox. How do I add more behaviors and properties to it? In a real context, I would like the component TextBox had a boolean property HasErrors,…
-
2
votes1
answer231
viewsHow to change the size of a screen through an event in C# WPF
How is it possible to make a change in the size of a Form(Window) in WPF, by changing its Heigth and Width and thus increasing and decreasing the screen according to the reported values? For…
-
2
votes0
answers41
viewsClient Rest + WPF - PUT method (UPDATE)
Hello, folks! I am trying to implement a method to update (update) information in a WPF application. Apparently, everything is correct, however, the method does not work. Here is the code: This is…
-
2
votes1
answer132
viewsWhy is it not recommended to use the C# project event with WPF and MVVM?
I am too young for WPF I am doing a project using MVVM and Entity Framework and it has been suggested not to have any event Click to a button in the code behind a window, for what reason? What is…
-
2
votes1
answer125
viewsEffect on WPF window opening
I would like to create an effect on the opening of my WPF window, similar to the opening of Windows 10 Weather and Mail windows. When I open the window, Background gets a color and an image, then it…
-
2
votes1
answer39
viewsTexblock - Make a text change event
I’ve seen the property of TextBlock does not have an event when changing text. Is there any way to do an event when the text is changed? * Remembering that it is for WPF and not Windows Forms. This…
-
2
votes2
answers922
viewsRecover External IP without third party services
I have a WPF application. I need to know the external IP of the machine running this application. I found some tutorials that teach to do this through the method DownloadString() class WebClient…
-
2
votes1
answer61
viewsHow to disable Ctrl+V from the contextmenu?
In the textbox you can’t paste at all, the following code works right: private void Textbox_PreviewExecuted(object sender, ExecutedRoutedEventArgs e) { if (e.Command == ApplicationCommands.Paste) {…
-
2
votes2
answers1251
viewsWPF C# String Format
I have a usercontrol with the following configuration: <UserControl x:Class="PainelPendencias.View.PendenciaConsulta" x:Name="uCPendenciaConsulta"…
-
2
votes1
answer62
viewsString search in database using Linq C# wpf
I have a bank and I want to run a search in the name field, but I also want the customer to be able to search for parts of the string or even with uppercase and minuscule letters. by the time my…
-
2
votes0
answers49
viewsIs it normal to pass null variables from the client side to the service side?
My goal is to create three applications: in WCF, in ASP.NEW Web API and another in WPF. My question is this:: It is normal, the data that we initialize on the client side namely (WPF) and that we…
-
2
votes1
answer361
viewsWPF using MVVM - Whose responsibility is it to open a new window?
In MVVM we have Views, Viewmodels and Models. All the business logic of my application is in models, where I use the viewModels to manage them, in addition to Binds and commands that are sent from…
-
2
votes1
answer201
viewsHow do I instate a class within a wpf?
The thing goes beyond that, the problem is that it always returns this error by instantiating this class: namespace AlmoxarifadoUpas { class ConsultaMaterialEntradaSaida { private…
-
2
votes2
answers239
viewsChanging Cell Color according to IF condition in C# WPF source code
I have a Datagrid in a form in C# WPF, as it is possible to execute a method recovers each Cell contained in that Datagrid and assign a possible value, or change the background color? For example I…
-
2
votes1
answer431
viewsAnimate a side menu in WPF
Hello, I’m now entering the world WPF (I come from MVC), and I’m with a question: I’m trying to animate an expandable menu, IE, when the user clicks the button, it expands and when you click again…
-
2
votes3
answers330
viewsListbox selection
Every time I move an item up or down a listBox he loses focus of the item. I’m not always able to focus on the item. For example, let’s assume my list has 200 items. Then I want to move the item…
-
2
votes1
answer269
viewsError starting WPF application
When starting my application, an error message is displayed. The problem is that I cannot locate the source of the problem. Before I couldn’t, it started today. I thought it might be some…
-
2
votes1
answer112
viewsMahapps - How to create Menu User Button in the Application Title Bar
I have a button user in my title bar that will allow it to switch between users or exit the application. How do I create a menu that contains these two functionalities?…
-
2
votes1
answer30
viewsAdaptive Storyboard (WPF)
I have an animation in my WPF project and I wanted to know if there’s any way Storyboard can be responsive. As in the settings of Margin and Height/Width are responsive marking the auto option…
-
2
votes1
answer196
viewsDoubt about Visual Inheritance between Windows in WPF
I’m new to WPF and I’d like to clear up a question that I think most people have, but can’t quite clear up, which is the visual heritage of windows. Imagine that all my sign-up screens should look…
-
2
votes2
answers1855
viewsStopwatch construction
I’m building a stopwatch using WPF. When I performed some tests, I realized that the timer on WPF is delayed in relation to my timer iPhone. The difference starts to appear from 8 seconds after the…
-
2
votes1
answer223
viewsLivechart - Fill Cartesian Chart with Sql Server Query Data
I have a Datacontext set in a Cartesianchart which does not display the data... no error is displayed, just think I’m making wrong use of the Datacontext and I can’t fix it, I’m using the package…
-
2
votes1
answer152
viewsHow to change Imagebrush background?
Follows code XAML: <TextBox /> <TextBox.Background> <ImageBrush x:Name="image_background" Stretch="Fill" TileMode="None" AlignmentX="Left" AlignmentY="Center" />…
-
2
votes2
answers130
viewsThe Binding inside a Compositecollection does not work
I am using a Combobox in a WPF application and when a function is activated, it loads a List<string> coming from a webservice to a property on the screen. My problem is that I can’t get…
-
2
votes3
answers258
viewsIs there a way to dynamically add attribute to instantiated object in C#?
Well, in C# we put attributes as follows: [Required("Este campo é obrigatório")] public string Nome {get; set;} What I would like to know is whether there is a way to add attributes dynamically to…
-
2
votes1
answer683
viewsButtons with WPF images
I’m new in WPF and I’m wanting to create a button, where its content will only have a background image and nothing else. Will not have border, background color or text, just a clickable image. I…
-
2
votes0
answers54
viewsWPF and MVVM Standard, doubts
I’m studying C# and I’m having to develop a WPF application with the MVVM standard. One question I have about this pattern is in relation to events, I have read in some places that it is not…
-
2
votes2
answers117
viewsHow to turn an array of bytes into an image in WPF?
I have an array of bytes like this: private byte[] m_Frame I need to turn him into an image, only how I’m in one WPF it is not possible to simply play a bitmap within a PictureBox because that…
-
2
votes2
answers172
viewsScroll Element of the WPF C#Datagrid class
I have a function that creates a grid, But I don’t know how to get that value, the function is down here: using System.Windows.Controls; public override FrameworkElement criar() { if (formulario ==…
-
2
votes0
answers16
viewsProblem with Datagrid Header Background
I have the following block of code setting the style of Header in my shampoo: <Style TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="Background" Value="DimGray"/>…
wpfasked 6 years, 4 months ago Gilthayllor Sousa 97 -
2
votes1
answer25
viewsHow to change the view of toggle buttons based on a Binding in WPF Datagrid
Hello, I am new with XAML/WPF and I have the following problem. I have a DataGrid which receives as Itemssource a ObservableCollection<DataEstoque>() thus public class DataEstoque { public…
-
2
votes1
answer46
viewsC# WPF Binding a 2 Radiobuttons as per a Boolean
Good staff. <GroupBox Header="Tipo de operação" HorizontalAlignment="Left" Height="55" Margin="10,70,0,0" VerticalAlignment="Top" Width="296"> <Grid x:Name="gridOperationType">…
-
2
votes1
answer133
viewsWhen Maximize a wpf page c# it overwrites the windows taskbar
I am creating a project in wpf and needed to replace the buttons minimize, maximize and close, follows condition used: if (sender == checklist.btnMaximizar) { if (WindowState ==…
-
2
votes1
answer220
viewsC# problems loading Data Grid using Datetime
Good night. I have one dataGrid which I carry using Entity Framework, however in dataGrid my date appears MM/dd/yyyy, I want to remove the time and format the date to dd/mm/yyyy, and in the validity…