Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
About my WPF app to draw a Bolt Hole Pattern.
Message
From
25/07/2008 15:37:12
 
 
To
25/07/2008 12:49:51
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Miscellaneous
Thread ID:
01334102
Message ID:
01334148
Views:
10
>1. I'm having to manually update the ListView, by setting ItemsSource to null and then back to the HoleList. I must need to do some Notify stuff with the list, but don't know what to do. The list is jsut a list field on the main window class, so maybe that is the problem.

change:
public List<Hole> HoleList;
to:
public System.Collections.ObjectModel.ObservableCollection<Hole> HoleList {get; set;}
and
HoleList = new List<Hole>();
to:
HoleList = new System.Collections.ObjectModel.ObservableCollection<Hole>();
You may also need to implement the INotifyPropertyChanged here:
public class Hole //:INotifyPropertyChanged
>2. Too manu decimals places are showing up the ListView. Is a ValueConverter thingy needed?

Yes use a converter, I can help with code if needed.


>3. I want the textboxes to select all text when you tab into them.
<TextBox Name="txtBoltCirDia" 
         Text="{Binding Path=BoltCirDia, ElementName=winBoltCircle}" Height="25" Width="100" 
         PreviewGotKeyboardFocus="TextBox_PreviewGotKeyboardFocus" />
private void TextBox_PreviewGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
  {
  ((TextBox)sender).SelectAll();
  }
You could also create an attached property to do this, similar to what I showed you in the MSDN thread:

http://forums.msdn.microsoft.com/en-US/wpf/thread/8af8287b-a9e8-49fe-9283-bdc52392e35f

>4. I want a spinner control to drive the Hole Count and Start Angle textboxes. Looks liek WPF doesn't have this?

I need to write one of these too. I'll see what I can come up with, should be pretty easy.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform