wpf-controls

How to bind a datatable to a wpf editable combobox: selectedItem showing System.Data.DataRowView

六眼飞鱼酱① 提交于 2019-12-24 07:28:46
问题 I bound a datatable to a combobox and defined a dataTemplate in the itemTemplate.i can see desired values in the combobox dropdown list,what i see in the selectedItem is System.Data.DataRowView here are my codes: <ComboBox Margin="128,139,123,0" Name="cmbEmail" Height="23" VerticalAlignment="Top" TabIndex="1" ToolTip="enter the email you signed up with here" IsEditable="True" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}"> <ComboBox.ItemTemplate> <DataTemplate> <StackPanel>

User control with custom properties

做~自己de王妃 提交于 2019-12-24 05:04:52
问题 I'm trying to create a UserControl which is a legend of a graph item, I've defined it so it has a label with the graph name, a check box which define whether we show it or not and a rectangle with the graph color. The xaml is defined like this: <UserControl x:Class="Resources.LegendItem" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http:/

How to use Grid inside Grid (Nested Grid) on Devexpress tools in WPF

瘦欲@ 提交于 2019-12-24 05:04:29
问题 I am stuck here that how i can use nested grid on devexpress grid control.I research alot but couldn't find anything good.Here is my XAML <dxdo:LayoutPanel Caption="Photography Jobs" AllowClose="False" Name="pnlShotoJobs" GotFocus="pnlShotoJobs_GotFocus"> <my:GridControl Name="dgPhotoJobs" MouseDoubleClick="dgPhotoJobs_MouseDoubleClick"> <my:GridControl.Columns> <my:GridColumn FieldName="JobName" Name="grdColumnJobName" /> <my:GridColumn FieldName="JobDate" Name="grdColumnJobDate" /> </my

How to set the usercontrol for ribbon window in WPF?

北城余情 提交于 2019-12-24 02:43:14
问题 First I've created a WPF application, then I added new RibbonWindows to the application, and called it RibbonWindow1. Now I want to set the content of the ribbon control via the code belowe and show the ribbon: RibbonWindow1 ribWindow = new RibbonWindow1 { Title = "This is a ribbon window", Content = new UserControl1() }; ribWindow.ShowDialog(); But I can't see the ribbon bar. If I remove content the ribbon will be shown, also if I use drag and drop I can show it, but I want to do it via

How to set the usercontrol for ribbon window in WPF?

為{幸葍}努か 提交于 2019-12-24 02:43:07
问题 First I've created a WPF application, then I added new RibbonWindows to the application, and called it RibbonWindow1. Now I want to set the content of the ribbon control via the code belowe and show the ribbon: RibbonWindow1 ribWindow = new RibbonWindow1 { Title = "This is a ribbon window", Content = new UserControl1() }; ribWindow.ShowDialog(); But I can't see the ribbon bar. If I remove content the ribbon will be shown, also if I use drag and drop I can show it, but I want to do it via

WPF Frame control

谁说胖子不能爱 提交于 2019-12-24 01:53:05
问题 I have a WPF application containing a Frame control. The frame control displays the html content. The html page contains a JavaScript function which I want to call after html page is loaded on Frame and from the WPF code ? Is there a way I can call JavaScript method of html page loaded in WPF frame control and from within WPF code? 回答1: You can't interact with the HTML inside of a frame. In order to interact with HTML, you can use WPF's WebBrowser control of .NET 3.5 SP1. You can see in

How to bottom align text in WPF RichTextBox

烈酒焚心 提交于 2019-12-24 00:43:30
问题 How I can bottom align text in RichTextBox? It seems that control doesn't support it directly. So I am looking for ways to emulate it. Ideally I would have the boundary of the control fixed and end of text aligned with the bottom. 回答1: The text comes from a ScrollViewer named PART_ContentHost inside the default control template for the TextBoxBase which is wrapped by the RichTextBox. You should override the control template and either have the ScrollViewer declare its VerticalAlignment to be

PopUp window on a specific time in WPF?

江枫思渺然 提交于 2019-12-24 00:08:41
问题 How can I create and show a popup window at a specific time in WPF? What I mean how to display the window on the side of system tray. 回答1: You could use a timer if you're trying to make the thing popup in a certain number of hours/seconds/minutes (or work out how many hours/seconds/minutes are left until your specific time comes around). private System.Windows.Threading.DispatcherTimer popupTimer; // Whatever is going to start the timer - I've used a click event private void OnClick(object

How to change background color of buttons on click on any of them?

霸气de小男生 提交于 2019-12-23 19:29:55
问题 I have 3 buttons. I created a style that I use for all of three of the buttons to show MouseOver and Pressed states. I need to have logic to indicate which button was selected / clicked. If the button is clicked then the background color should stay/be as for pressed state and other two buttons should be reset to background color to be as a normal state. Below is the code I have. I am wondering if it is possible to achieve all in XAML or how to do it in code behind? Thank you I advance.

WPF: Inheriting from Window

六眼飞鱼酱① 提交于 2019-12-23 12:03:22
问题 I seem to be having some trouble creating a custom window type that derives from System.Windows.Window. There seem to be two problems that are occurring. Firstly, there's a compile-time error stating Cannot find the static member 'ContentProperty' on the type 'Control' This is in reference to the ContentPresenter element in the ControlTemplate for the custom window (see code sample for BaseWindowResource.xaml below). I don't know why this is happening, since BaseWindow derives from Window,