Please excuse my ignorance, I only started coding in Silverlight recently.
I tried implementing the command pattern in Silverlight and hit a wall.
They say commands are great, because you can write them into xaml, so you can keep your code-behind clean, also you have loose coupling between your view and your viewmodel because there is n...
Hi,
The default DataTemplate in a wpf application displays the result of the .ToString() method. I'm developing an application where the default DataTemplate should display nothing.
I've tried:
<Grid.Resources>
<DataTemplate DataType="{x:Type System:Object}">
<Grid></Grid>
</DataTemplate>
</Grid.Resources>
But this doesn't w...
In my WPF form I have a textbox.
When a timer elapses, the content of the textbox needs to be fetched.
The timer elapsed is working in a different thread then the UI.
The question is kinda two-fold:
What is the easiest, most readable way to read the value from a GUI thread cross thread (I found several and they look too verbose for wh...
I have found some evidence that this is possible,
self.scene = Canvas()
Application.LoadComponent(self.scene, Uri('app.xaml', UriKind.Relative))
but my code is failing:
class Program
{
[STAThread]
static void Main(string[] args)
{
Canvas scene = new Canvas();
Application.LoadComponent(scene, new Uri("app....
I'm working on a new C# application using WPF. I was under the impression that WPF was vector based and that text/buttons would be drawn in a resolution independent way. When running my application it’s fairly obvious that my application isn’t being drawn using vectors. Some of the text gets fairly blocky, and when using the windows magn...
Hello,
I'm building simple dictionary application using WPF.
I'm using MVVM pattern, databinding and FlowDocument to display words to user.
UI consists of 2 controls: ListBox and FlowDocumentScrollViewer.
Dictionary data comes from XML file, format of this string may look like this
<b>Word</b> - Some description. Another <i>descrip...
I have a custom control
public partial class MyUserControl : UserControl { ... }
I get 'null' calling
VisualTreeHelper.GetDrawing(this)
How can I change MyUserControl to return non-null value? Any overloads, or what?
This is not a practical task, just a research.
...
Is there a simple way to cause a (full screen) WPF app to launch on a secondary display? I know I could get the entire virtual desktop rectangle and calculate an offset, but is there a more direct way?
...
I have two tabs in my TabControl. I need to run a method (checks if data needs to be saved to the database) each time user switches from one tab to the other (switch can be in any direction: from tab1 to tab2 and from tab2 to tab1). How do I do this?
I thought about using ButtonBase.Click event that gets attached to each tab but it does...
WPF Noob question:
Can WPF applications can have their appearance change at runtime? I understand, through styles, that one can change the appearance of controls and UI elements, but I was envisoning something more along the lines of having two applications: one "editor" application and a "game" application, both running essentially the...
I've got a small test WPF MVVM application working in which a view allows the user to change the first or last names of customers and the full name automatically changes, so communication is going from M-to-MV-to-V and back, everything is fully decoupled, so far so good.
But now as I look to how I will begin extending this to build larg...
I am very confused between WPF and WinForm. I am not able to understand the usage of WPF over WinForm?
What is the usage of WPF ?
...
I made a WPF app that uses Web Services. It is failing on all computers except the dev machine with the message -- System.MissingMethodException. I guess the point where it fails is the point where it tried to access the Remote webservice (website).
Has anyone had any experience with WPF and webservices? Should I spend 2 more days porti...
I'm working with the wpf toolkit datagrid and have a column that is populated with toggle buttons. Using the below style I change the background color if the toggle button is selected and also on mouse over. Unfortunately if I have virtualization enable, when I make a select of a toggle button in a cell and scroll down in the grid I wi...
I have spend a lot of time trying to figure out how to bind data in my XML file to the TreeView control but I do not know where to start. I even tried going through http://stackoverflow.com/questions/188001/two-way-binding-of-xml-data-to-the-wpf-treeview and Josh Smith's code sample on codeproject, but still can't understand how to begin...
In Windows Forms, it was useful at times to have one window that inherited from another window. But in WPF, this is not allowed. Why is there no visual inheritance for WPF windows?
...
I'm using XamlReader.Load() to load an external XAML file which may contain some images and other media.
I'm using ParserContext to set the baseUri, so if the paths inside the XAML file are correct, the media is loaded successfully.
// works
var pc = new ParserContext();
pc.BaseUri = new Uri(baseUri, UriKind.RelativeOrAbsolute);
using...
I want to be able to traverse the visual ui tree looking for an element with an ID bound to the visual element's Tag property.
I'm wondering how i do this. Controls don't have children to traverse.
I started using LogicalTreeHelper.GetChildren, which seems to work as intended, up until i hit a TreeView control... then LogicalTreeHelp...
I have a TabControl with TabPage1 and TabPage2,
In TabPage1, there is another TabControl1 with 2 Items TabPage11 and TabPage12.
In TabPage2, there is another TabControl2 with 2 Items TabPage21 and TabPage22.
Each item (TabPage11 , TabPage12, TabPage21 and TabPage22) has its own View (in form of UserControl) and ViewModel. there is data...
I'm developing an application that needs to be resolution independent. The application will always be full screen so I have to design my UI so that the monitor resolution will not impair the use of the application. I've been spending a good amount of time playing around with WPF trying to accomplish this. Today I found out about the View...