wpf

Assigning Roles to Users

I'm having trouble figuring out how to assign roles to users. I've got the log in mechanism working, but need to figure out how to use roles defined to give users certain access. I have a database with these tables: Tables ------ UserTbl RolesTbl UserInRoleTbl ------- ...

ItemTemplate vs ControlTemplate

I am confused with learning about WPF. I see ControlTemplate used to determine how each item in a listbox looks. Isn't that what the ItemTemplate is used for in listboxes? What is the difference? ...

The good 3D GUI engine

I know WPF is one of good 3D GUI engine, but I want to know other good 3D GUI engines? ...

how to set wpf MessageBox.Owner to desktop window because SplashScreen closes MessageBox

I am using the SplashScreen feature in WPF by setting a bitmap's Build Action to Splashscreen. Behind the splash screen licensing information is being check, and if it fails I show a MessageBox. According to this Feedback, it is because the MessageBox.Owner is the splash screen and as soon as another window is open even if it is a Mess...

Display custom object data to ListBox WPF

I have a ListBox in WPF application as : <ListBox HorizontalAlignment="Left" Margin="16,37,0,16" Name="lbEmpList" Width="194" SelectionChanged="lbEmpList_SelectionChanged" FontSize="12" SelectionMode="Single"> </ListBox> I have three buttons: Add, Remove and Update that will add, remove and update items to the list box. I am adding I...

Anyone know of a simple WPF/Silverlight data access framework?

Does anyone know of a simple WPF or Silverlight framework which enables you to e.g. define some database tables in e.g. SQL Server compact database and then the framework automatically creates the Window classes etc. which allows a user to login and edit that data? I'm not looking for a complicated MVVM pattern example, it can be hard c...

Absolutely centered content inside a WPF layout panel

I need to find a way of absolutely centering the content of a LayoutPanel in WPF. I have two textblock elements which must render at the vertical and horizontal center of the panel without relying on absolute heights and widths. This is something i can do quite easily with a single element since any ContentControl can have it's verti...

WPF chart controls

I am looking for a very simple WPF chart which should have a 2D graph and and should have pan and zoom facilities . ...

Program does not contain a static 'Main' method suitable for an entry point

Suddenly my whole project stopped compiling at all, showing the following meessage: Program 'path_to_obj_project_folder' does not contain a static 'Main' method suitable for an entry point I made no changes to project properties, just added some classes, moved some other classes into folders. Its an WPF Application project so it shoul...

Themable User Controls in WPF

How can I create a UserControl in WPF that has a basic default style but can also easily themed when needed? Do you have some good guidelines, blog entries or example that explain this specific topic? Thank you in advance, Marco ...

only one usercontrol instance specified in datatemplate

I have specified a userControl as a dataTemplate. <TabControl IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Path=Pages}"> <TabControl.ContentTemplate> <DataTemplate> <uc:ItemTemplateControl /> </DataTemplate> </TabControl.ContentTemplate> </TabControl> The userControl is very easy and just binds...

WPF 3D Model Drawing Tools

Are there any applications out there for 3D modeling that would output the finished product to an array of points (X,Y,Z) that you could then import to a WPF 3D Model? ie: <MeshGeometry3D Positions="0,0,0 10,0,0 0,10,0 10,10,0 0,0,10 10,0,10 0,10,10 10,10,10" TriangleIndices="0,2,1 1,2,3 0,4,2 2,4,6 0,1,4 1,5,4 1,7,5 1,3,7 4,5,6 7,6,5 ...

Model View ViewModel in WPF with WebBrowser

Hi All Im writing an app in WPF using MVVM pattern, where Im restricted to binding to properties and commands exclusivley However, I want to use the WebBrowser control which can only take an html string for content as a parameter to a mthod, and not a property. I was going to create a new control derived from Webbrowser that has the r...

Selecting an object on a WPF Canvas?

I have a WPF Canvas with some Ellipse objects on it (displayed as circles). Each circle is from a collection class instance which is actually a custom hole pattern class. Each pattern has a certain number of circles, and each circle then gets added to the canvas using an iteration over the collection using the code below. So, the canvas...

Why is my WPF textbox "kinda" readonly?

I have a text box in WPF that is part of a datatemplate for a listbox. In that text box I can delete, backspace, spacebar, but I can NOT type in new words, letters or numbers. I CAN paste from notepad though. What am I missing here? <ListBox Grid.Column="1" ItemsSource="{Binding Details}" VirtualizingStackPanel.Vir...

About WPF RichTextBox with Spellchecker enabled

Hi there, Im using SpellCheck.IsEnabled="True" ...property in a wpf application, it works in machines with S.O Windows XP and with Office 2007, but whats the matter with Pc with Office 2003? it seems the spellchecker is disabled, this issue can be fixed with code? thanks in advance! ...

Loading/Using Resource Dictionaries from a WinForms hosted WPF control

I have a Windows Forms application that needs to host a WPF control at runtime. I have the basic hosting and interaction complete (using an ElementHost control) and everything works fine until I try to do something that requires the WPF control to make use of some custom resource dictionaries that are defined. (The WPF control and all of...

Generate Image at Runtime

Hello, I am trying to render some XAML at runtime. My XAML is dynamically constructed in a StringBuilder. As an example, here is a sample: StringBuilder xaml = new StringBuilder(); xaml.Append("<Canvas xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" "); xaml.Append("xmlns:x=\"http://schemas.microsoft.com/winfx/20...

WPF Dependency Property Data Binding Problem

I created a UserControl in WPF. This user control has several text boxes that are bound to properties on a database object which is referenced by proptery on the UserControl. The xaml looks like: <TextBox Name="_txtFirstName" Text="{Binding Path=Contact.FirstName, UpdateSourceTrigger=PropertyChanged}"/> This worked properly until I...

MouseLeftButtonDown on canvas requires too much precision

I am responding to MouseLeftButtonDown events on elements added to a WPF canvas. It all works fine when clicked (i.e. the eventhandler fires off correctly), but it requires too much precision from the mouse pointer. You have to be perfectly on top of the circle to make it work. I need it to be a little more forgiving; maybe at least 1 or...