wpf-controls

wpf datatable column name can not have slash /

旧城冷巷雨未停 提交于 2019-12-11 07:43:20
问题 I'm very new to WPF. I'm having a very weird issue to just make a table, here is the code I have: DataTable table = new DataTable(); table.Columns.Add("request/sec", typeof(string)); DataRow newRow = dataTable.NewRow(); newRow["request/sec", "na"); but it only shows a column name with "request/sec" and an empty row however, if I do: DataTable table = new DataTable(); table.Columns.Add("test(request/sec)", typeof(string)); DataRow newRow = dataTable.NewRow(); newRow["test(request/sec)", "na");

How to increase the particular row height in the WPF DataGrid when mouse is over that row

丶灬走出姿态 提交于 2019-12-11 07:34:29
问题 I want to increase the particular row height to twice in the WPF DataGrid when mouse is over that row but the remaining rows height should not be changed. When the mmouse moves over on the another row only that row height should be double and the previuos row height should become normal. Please let me know how to do this. Previously i had the following solution. But here when the mouse over a particular row, the row height is doubled but the row is rendered. I don't want this concept, I want

Embed Icon in WPF application

試著忘記壹切 提交于 2019-12-11 07:23:33
问题 I am using an icon in my application in two situations. In XAML as an Image for the Button using DynamicResource. In C# as NotifyIcon this.notifyIcon.Icon = new SystemDrawing.Icon("..//..//Shutdown.ico" ); My problem is if I delete the image the application not working. How can I bind the image with the exe file so that the application can run only with the exe file? 回答1: Add the icon to the project as a Resource (not Embedded Resource, there is a difference), then access it with using(Stream

Query on MVVM design pattern on WPF

孤人 提交于 2019-12-11 06:15:24
问题 I am using MVVM architecture. I have a usercontrol UC as a View Model is a ModelData class ViewModel ( UCViewModel ) is binded to a usercontrol. I have three more usercontrols that is inside the usercontrol UC ( discussed above). Let's say uc1, uc2 and uc3. and the visibility of uc1 , uc2 and uc3 inside UC depends on the type selected ( which ever radio button is selected ). Since UC is binded to UCViewModel and I have to do all the stuff related to uc1 , uc2 and uc3 inside UCViewModel. Can I

How to display a control dynamically in wpf?

 ̄綄美尐妖づ 提交于 2019-12-11 06:04:21
问题 I have a collection with fields cityname, statename and countryname and I bind that collection to my wpf form. I want to display the cityname in a Textbox, the statename in a combobox and the countryname in a combobox. All the textboxes and comboboxes should come dynamically. How can I do this job? Any one suggest me how to design this form dynamically in wpf using MVVM I am trying to do this code but not get result properly <UserControl.Resources> <DataTemplate x:Key="IntegerTemplate">

Combobox with custom dropdown(Popup) template and more

左心房为你撑大大i 提交于 2019-12-11 05:52:37
问题 I am having a problem hooking up some events in my custom dropdown or Popup template in my combobox. This custom template by the way looks like the one in IE 10. Here's the picture I got the partial look (the one below is mine). But I'm having a problem deleting an item in history list. Below is my PART_Popup template <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="

Generating Views (UserControls) using ContentControl

谁都会走 提交于 2019-12-11 05:49:25
问题 I have a UserControl (MainView) which needs to display another UserControl inside itself. Depending on some condition, it will display either AView or BView (they both appear on the same place in MainView). I am using ViewModel first approach, so Views are generated through data templates: public class AView : UserControl { } public class BView : UserControl { } public class AViewModel : ViewModelBase { } public class BViewModel : ViewModelBase { } From the resource usage point, is there a

Datagrid (editable issue, access issue) in WPF

我怕爱的太早我们不能终老 提交于 2019-12-11 05:46:23
问题 I created a Datagrid, as shown in this figure --> http://img682.imageshack.us/img682/5109/datagrid.png where user is supposed to enter data. In one of columns, I added Combobox.Now, the Datagrid won't allow me to enter data in the cells. IsReadOnly="False" was also not working, it was giving some "EditMode exception". So, what I did was, I created textblock and within it created combobox and textbox as shown here: <toolKit:DataGrid Width="725" Height="100" HeadersVisibility="Column" Focusable

How to Add dynamic control instead of static control?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 05:36:52
问题 I have a collection with fields cityname, statename and countryname and I bind that collection to my wpf form. I want to display the cityname in a Textbox, the statename in a combobox and the countryname in a combobox. All the textboxes and comboboxes should come dynamically. How can I do this job? Any one suggest me how to design this form dynamically in wpf using MVVM I am trying to do this code but not get result properly. Either I get everything as textbox or combobox, but what i need is

The name <> does not exist in the namespace <> (for Library project)

丶灬走出姿态 提交于 2019-12-11 05:27:53
问题 I'm new to C#/Windows store apps development and I have a problem: I'm getting The name "CustomTemplate1" does not exist in the namespace "using:QSTLibrary.WIN8" I work on a project which has 2 libraries (one portable(without any GUI) and one platform specific(Win store apps)) and a startup project which is based on these 2 libs. On the platform-specific library I want to add a templated control , but when adding it using the add -> new item -> templated control the Generic.xaml from the auto