Hello.
Hi! I am trying to cancel (prevent) some text editing in RichTextBox.
I am using TextChanged event, but I did not find the way how to cancel or rollback some changes, any ideas?
private void mainRTB_TextChanged(object sender, TextChangedEventArgs e)
{
TextRange text = new TextRange(mainRTB.Document.ContentSta...
I have the following problem:
there is a class with a couple of string properties
there is a collection of such class entities
That collection is shown in tree on the left of some windows and details shown on the right. I'm binding string properties of selected node to comboboxes in details.
First combobox always have the same Ite...
I have several forms with many textboxes/comboboxes, and I would like to have the "Save" button disabled while at least one of the fields are invalid. I've been able to setup some custom ValidationRules, like so (textbox example shown):
<Binding Path="Name">
<Binding.ValidationRules>
<my:TextFieldNotEmpty/>
</Binding.Val...
If I have the following control:
public partial class MyControl : UserControl{
public string MyControlText{
get { return MyTextBox.Text; }
set { MyTextBox.Text = value; }
}
public MyControl(){ ... }
}
How can I bind to the "MyControlText" property when I place the control on one of my pages, like so:
<lo...
I've got a WPF application with these three types of things...
WindowMain
UserControlZack
WindowModal
UserControlZack1 sits on my WindowMain...
<Window x:Class="WindowMain"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr...
Hi all,
I want to show datagrid content (rows,columns) in XPS document.I have 20 columns. When i sent datagrid to XPS with XPSDocumentWriter.Write method ,it just show some columns not all of them.How can i show all columns and rows in xps(like Xceed datagrid xps exporting)
Thx
...
I am currently working with Panels in WPF, and I noticed that as regards the Width and Height properties, there are also two other properties called ActualWidth and ActualHeight.
ActualWidth
Gets the rendered width of this
element. This is a dependency
property. (Inherited from
FrameworkElement.)
Width
Gets or se...
I am currently building an application that consists of several components, each of which is essentially a WPF user control with a little C# code around it for the plugin system to work (using MEF).
The problem I am having is that each component should include an icon and for niceness purposes I defined that as a System.Windows.Media.Br...
Has anyone ever created a custom markup extension in WPF or Silverlight? When would you ever want or need to do this? Any tips or sources on how to do it?
...
Guys, how can I import the System.ServiceProcess namespace into a WPF project in VB.net (not C#)? The ServiceController object is not in the toolbox in VS2008 and can't see to figure it out. Any ideas? If that particular namespace cannot be imported into WPF projects, could somebody suggest another way of controlling windows services fro...
Hi, this is driving me pretty crazy. I'm trying to get a WMV file to autoreverse after it's done playing, but it doesn't work. I've tried setting Storyboard autoreverse to true, but this throws an error saying that
"Clocks with CanSlip cannot have parents or ancestors with AutoReverse, AccelerationRatio, or DecelerationRatio."
Is this...
Hi,
i have a LoginWindow with username and password to access in the software after that the user authenticated i want show in the next window(the mainWindow of the software) the name of the user authenticated in a TextBlock ...i show a code snippet of my LoginWindow:
public partial class Window1 : Window
{
public Window1...
I have a little problem right now and I don't know how to fix it. I want to add two resources to a window. One is a XAML File style resource, the other a ValueConverter Class.
Both of them work if I use only one resource at a time:
<Window.Resources>
<ResourceDictionary Source="Resources\MyStyles.xaml" />
<Window.Resources>
or
...
I am new to WPF programming model. I have few queries:
Does Page tag in XAML (in an XBAP application) is of type FrameworkElement?
if i have a child element lets say Frame inside a Page. I pass that frame element in a function in another assembly. Now i try to navigate back to the Page from Frame control's Parent property i am not able...
My current project creates UI by WPF at runtime. Everything works well. The only issue about it is that the global WPF template is ignored for some reason.
We created a skin that is attached to the main form and thus used by all xaml created UI elements.
My own code just dynamically creates items like this:
var textBox = new TextBox()...
hi there,
i created a ListBox that has a DataTemplate as Itemtemplate.
however, is there an easy way to access the generated UIElement
instead of SelectedItem in codebehind?
when i access SelectedItem i just get the selected object from my
ItemsSource collection. Is there a way to access the UIElement (ie. the
element generated from th...
My problem is simple. I want to select a nullable Type inside a combo box which is previously binded.
Please help me.
PS: Please do not supply any workaround, related to Modify my data, inserting a nullable inheritor or whatever related. It's there any straight forward way to achieve this???
I know they might be much people who had ...
If you set ResizeMode="CanResizeWithGrip" on a WPF Window then a resize grip is shown in the lower right corner, as below:
If you set WindowStyle="None" as well the title bar disappears but the grey bevelled edge remains until you set ResizeMode="NoResize". Unfortunately, with this combination of properties set, the resize grip also ...
How can I determine the width in pixels for a canvas (which has a certain width)?
I have a bitmap in an AnimatedImage control, and I know the bitmap's width in pixels, and I want to scale the bitmap so that it horizontally fits exactly the canvas. How can i determine this scale?
Note: I do not need to use RenderTargetBitmap, because t...
Are there any controls that anyone is aware of that I can use to stream firewire video into a WPF app. I do not need camera control or capture just the video. I need WPF hosting because I'll be adding WPF content on top.
I was hoping that with the addition of having direct X surfaces in WPF something like this might appear.
Ideally l...