I'm using .net WPF geometry classes to graph waveforms. I've been using the matrix transformations to convert from the screen coordinate space to my coordinate space for the waveform. Everything works great and it's really simple to keep track of my window and scaling, etc. I can even use the inverse transform to calculate the mouse po...
How can I change the spellchecking language of a WPF textbox to french using XAML?
I tried this but it doesn't work.
<TextBox AcceptsReturn="true" SpellCheck.IsEnabled="true" FontSize="12" BorderBrush="Blue" Height="100" Language="fr-fr" />
French is supposed to be one of the 4 supported languages for spellchecking in WPF so I don't u...
I'm on a roll today...
I have the following code delaring a dependency property inside a class called ActionScreen:
#region Dependency Properties & Methods
public string DescriptionHeader
{
get { return (string)GetValue(DescriptionHeaderProperty); }
set { SetValue(DescriptionHeaderProperty, value); }
}
// Using a DependencyPr...
I'm wondering what happens after the constructor is done executing my code, because the constructor is taking like 10 seconds to run on a cold start up, but according to the profiler, my code is done executing in like 2 seconds.
Also stepping through the code in the debugger, after the last line of my constructor, I sit there and wait f...
Ok, I didn't want a bunch of ICommands in my MVVM ViewModels so I decided to create a MarkupExtension for WPF that you feed it a string(the name of the method), and it gives you back an ICommand that executes the method.
here's a snippet:
public class MethodCall : MarkupExtension
{
public MethodCall(string methodName)
{
Method...
Sorrry guys, I'm stuck here.
I have a few grids, I also have CollectionViewSource objects associated with those grids.
Now, I'm trying to apply CollectionViewSource.SortDescriptions in ColumnHeaderClick method, and now I have to define almost the same method for each grid.
But the only thing I really need is to obtain in which Grid ...
I am getting started with Logging in a WPF desktop app, using Log4Net as the logging component. Here is my question: In a simple desktop app, is there any reason not to instantiate my logger as a property ov the App class (App.xaml.cs), like this?
public partial class App : Application
{
private static readonly ILog p_Logger = ...
I'm trying to animate a RadialGradientBrush in my application. I get the super helpful exception:
Additional information: 'System.Windows.Style' value cannot be assigned to property 'Style' of object 'System.Windows.Controls.Border'. '[Unknown]' property does not point to a DependencyObject in path '(0).(1).[0].(2)'. Error at object 'S...
I'm wondering how exactly the XAML sample (MSDN sample) works:
<Style x:Key="textBoxInError" TargetType="{x:Type TextBox}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip"
Value="{Binding RelativeSource={x:Static RelativeSource.Self},
Path=(Validation.Er...
After playing quite a bit of Bad Company 2 over the last month, I'm getting kind of tired of Alt+Tabbing out of my game to change the song on iTunes. I've got a fairly good iTunes controller library already built for a previous project I was working on, and I'd like to create a WPF application mimicking the BC2 UI that would overlay the ...
Good day.
I have started messing around with the MVVP pattern, and I am having some problems with UI responsiveness versus data processing.
I have a program that tracks packages. Shipment and package entities are persisted in SQL database, and are displayed in a WPF view. Upon initial retrieval of the records, there is a noticeable p...
Hi,
I bind a command to a button through command property and doing a command binding in the page it is placed. In execute method I create an instance of a class that contains the background worker and I start it (this is a long task). The background worker (bw) class contains a variable isRunning that it is set to true before DoWork me...
All,
I have a simple class.
public class Container : UserControl
{
public bool IsClickable { get; set; }
}
I have a class that extends this class.
public class ScrollingContainer : Container
{
public void Draw()
{
}
public void Update()
{
}
}
I have a custom class, that then extends ScrollingContaine...
Hello,
I've got about three years c# experience. I'd like to learn some WPF and the MVVM pattern.
There are a lot of links to articles on this site but I'm getting a little overwhelmed.
Would a sensible approach for a begginer to be forget mvvm for a while and just quickly learn a bit a of WPF, then come back to MVVM?
I had a leaf throu...
Update: I tried this on another, more cleanly installed, machine. I could not reproduce this on that machine. If I find out what offending (VSStudio) component causes this, I will let you know.
I create some UIElements from code behind and was anticipating the garbage collection to clear up stuff. However, the objects are not free-ed at...
I have the following xaml for changing the image for WPF button when mouse is on the button. It give below error. Any help is appreciated...
'System.Windows.Media.Animation.DoubleAnimation' animation object cannot be used to animate property 'Source' because it is of incompatible type 'System.Windows.Media.ImageSource'.
<Style TargetTy...
I have a user control from where I have to call the property of the window which contain the user control how can I access that property.
Suppose I have Title Property in my window and I want to access Title property of the window from the user control. Any idea
is That OK
(App.Current.MainWindow as MainWindow).Title;
Thanks in advan...
Im currently trying to create a Scene in WPF where I have around 250 controls on my screen and the user can Pan and Zoom in and out of these controls using the mouse.
I have run the WPF Performance Suite tools on the application when there are a large number of these controls on the screen (i.e. when the user has zoomed right out) the F...
In WinForms we could specify DialogResult for buttons. In WPF we can declare in XAML only Cancel button:
<Button Content="Cancel" IsCancel="True" />
For others we need to catch ButtonClick and write code like that:
private void Button_Click(object sender, RoutedEventArgs e)
{
this.DialogResult = true;
}
I am using MVVM, so I ha...
For the purposes of this question, I have a list box that uses wrap panel as its ItemsPanel, this list box is filled with 200x200 images, when a user's mouse hovers over a box, I scale the render transform by 2x. The problem is the content of the image gets clipped by the images below it, how can I override the Z-Order to the image to pr...