How can I disable a button until required data is entered in a TextBox?
I'm binding an Button to ICommand
public ICommand LoginCommand
{
get
{
if (_loginCommand == null)
{
_loginCommand = new DelegateCommand<string>(this.Login, this.IsValid);
}
...
Hi Guys,
I am working on an application that requires users being able to select a powerpoint file and then have it displayed on a WPF form using Powerpoint Viewer 2007. The reason for using Powerpoint Viewer 2007 is that not all the users of the application will have Powerpoint installed on their system.
Any help or link will be highl...
I am writing a WPF application and need to show info about video card installed in the system. I've faced a problem that I can't get pixel version supported by current video card. How can I do this using .NET? (importing of external code, may be DirectX libs, is also a suitable solution).
...
I am developing a large-ish application in WPF/WCF/NHibernate/etc. and have implemented the MVP pattern (although this question is still relevant to MVC) as the core architecture.
It feels quite natural to extend and add functionality as well as to come back and make changes on certain bits and pieces, as far as the core architecture is...
Please don't get caught up in my example, just bear with me for the sake of the question:
In my WPF application, if I wanted all TextBoxes to have a "green" background, I would easily set it as such in my Application.Resources.
<Style TargetType="TextBox">
<Setter Property="Background" Value="Green" />
</Style>
This works PERFECTLY....
I have a WPF window that has a toolbar. I have a collection of objects in my VM that I'm binding to. They appear as buttons but they always get pushed to the expanded drop down part of the toolbar. How do I make those buttons appear in the standard part of the toolbar?
I have the following XAML:
<ToolBarTray Grid.Row="1">
<T...
I have a style for a textblock that is set inside my app.xaml this is then applied to textblocked through out my application and works fine.
However i get an error: "could not create instance of type" if i apply this style to a textblock within my user control, how come this is a problem?
<UserControl x:Class="Client.Usercontrols.MyBut...
I'm trying to implement a piece of functionality that will let the user to drag files into an application to be opened in the FlowDocumentReader.
My problem is that is though I have AllowDrop=true on the FlowDocumentReader, the cursor does not change to the "drop here" icon but changes instead to "drop is not allowed" icon.
This happens...
I'm using the WPF Grid to align objects, and ran into a rather glaring issue regarding pixel alignment of columns. I tried to remove as many variables as possible, and managed to show the issue in this code:
<Window x:Class="Test.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft...
Hi Guys,
I wanted to create a button that had an image and a textblock as content. So i went about looking for an answer and found a post (http://stackoverflow.com/questions/1568883/reusable-custom-content-for-buttons) which told me to create a usercontrol.
I did this and it works great, i can set the image source and text through depe...
Is it possible to have a dynamic number of series for a WPF toolkit line chart? Every example I find declares the series manually.
I want to be able to have this type of data:
ObservableCollection<ObservableCollection>ChartPoint>>
When I add or remove ObservableCollections to the main OC, the chart should add or remove series.
I hav...
Is it possible to put a TabItem into a separate XAML and reference something like this:
<TabControl>
<local:MyTabItem/>
</TabControl>
In Separate XAML:
<UserControl x:Class="MyProject.MyTabItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
...
I'm using ItemsSource on a ListView. I now want to perform a search and filter the items with an SQL query, so I reassign the ItemsSource; but then an exception is thrown:
Items collection must be empty before using ItemsSource.
Alright, but how can I empty the items collection? Items.Clear is not allowed when using ItemsSource..
Okay, ...
Hey guys.
I want to make a WPF Grid in which users can drag and drop controls from one cell to another and when the user is dragging I need to draw tips on the screen, like arrows. It's as if the tips were in ANOTHER LAYER in the screen. That is, they are not drawn IN the grid I mentioned.
The problem is: I don't know how to OVERLAP a...
I have a WPF Popup control with a ListBox and a button in it. When I click the button, it should become disabled. The problem is, that when I disable the button, the Tab key goes out from the Popup. I tried to set the focus to the ListBox, after I set the button's IsEnabled to false, but that did not work. So, how can I set the tab focus...
How are you supposed to dispose of a BitmapSource ?
// this wont work because BitmapSource doesnt implement IDisposable
using(BitmapSource bitmap = new BitmapImage(new Uri("myimage.png")))
{
}
...
Hi All,
I have a VERY simple 3D space defined in WPF, which defines a 3D rectangle, I was hoping to be able to manipulate each one of the Point3D objects (in the "Positions") property on the MeshGeometry3D, but Im having trouble with it...
Here is my XAML:
<Grid>
<Viewport3D Name="ViewPort"
Focusable="true"
...
After reading the wikipedia article on WPF architecture, I am a bit confused with the benefits that WPF will offer me. (wikipedia is not a good research reference, but i found it useful). I have some questions
1) WPF uses d3d surfaces to render. However, the scenegraph is rendered into the d3d surface by the media integrated layer, whic...
I want to apply a style to all classes derived from Control. Is this possible with WPF?
The following example does not work. I want the Label, TextBox and Button to have a Margin of 4.
<Window x:Class="WeatherInfo.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/wi...
I have a text input area defined like this:
<TextBox>
<TextBox.Text>
<Binding Path="MyProperty">
<Binding.ValidationRules>
<valid:MyValidator/>
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
My problem is that, dependi...