|
You know, you should get one of those cheap Acer notebooks ($500-600) so you can still do work if you have problems on your Mac. My Acer ain't the most speedy thing in the world, but it has a dual-core AMD, 4gb of RAM, and a 250gb hard drive, and I use it for development on the road. It came with Vista Home Premium (32-bit), but I'm running XP-32 on it till Weven comes out. I think it cost me $549 at NewEgg (last year I think)...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I have a decent PC and a decent PC notebook in the house. What I lose, is OSX at the same time, which I've become accustomed to, AND none of them are as fast as my Mac, and I lose my desk/three monitor setup. Unless I strip down and retire my Mac in the meantime.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hi All,
Thanks for reply.
I ve tried _Save option in button content,but it is not working. Could u suggest some other solution.
|
|
|
|
|
That should work. Your machine may have ALT as the access key. Hit the 'ALT' button after invoking the application.
Are you overriding the style/template of the button ?
|
|
|
|
|
Thanks.
Its working fine after hitting the ALT button.But i need to undeline the letter while running the application itself. Is there any properties for that?
|
|
|
|
|
It is an OS setting for keyboards. See here[^]
|
|
|
|
|
Thank u very much... Its working fine..,
|
|
|
|
|
I have a ProgressBar control in a Window , and the ProgressBar is bound to a property in the window. A DispatcherTimer is used to count down seconds, and sets the bound property to the current value.
Setting the initial Value works fine, but subsequent settings don't seem to have an effect. I know the timer is ticking because there's also a countdown clock on the window as well, and it's counting down properly.
What am I doing wrong?
---------------
Resolution
---------------
I'm not sure why, but binding the Value property does not work. You actually have to set the Value property from within your code. While this is "okay" as a workaround, it seems strange to me that binding does not work here.
Any Comments?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Friday, June 5, 2009 12:31 PM
|
|
|
|
|
John Simmons / outlaw programmer wrote: Any Comments?
Yeah - what did you do wrong?
Binding Value to either a dependency property or a property with INotifyPropertyChanged
implemented works for me. For example:
public partial class Window2 : Window
{
public Window2()
{
InitializeComponent();
}
public static DependencyProperty PercentDoneProperty =
DependencyProperty.Register("PercentDone", typeof(double), typeof(Window2));
public double PercentDone
{
get { return (double)GetValue(PercentDoneProperty); }
set
{
SetValue(PercentDoneProperty, value);
}
}
MyTestClass mtc = new MyTestClass();
private void progbar_Loaded(object sender, RoutedEventArgs e)
{
progbar.DataContext = this;
DispatcherTimer dispatcherTimer = new DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 250);
dispatcherTimer.Start();
}
void dispatcherTimer_Tick(object sender, EventArgs e)
{
if (PercentDone < 100)
PercentDone = PercentDone + 1;
if (mtc.PercentDone < 100)
mtc.PercentDone = mtc.PercentDone + 1;
}
}
public class MyTestClass : INotifyPropertyChanged
{
private double _percentDone = 0;
public double PercentDone
{
get { return _percentDone; }
set { _percentDone = value; Changed("PercentDone"); }
}
#region INotifyPropertyChanged Implementation
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void Changed(string propertyName)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
#endregion
}
<Window x:Class="WPFTester.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WPFTester"
Title="Window2" Height="450" Width="500" >
<Grid >
<StackPanel >
<ProgressBar x:Name="progbar" Width="200" Height="20" Value="{Binding Path=PercentDone}" Loaded="progbar_Loaded" />
</StackPanel>
</Grid>
</Window>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I bound to a regular property, not a dependency property. I never found any reference that said I had to do that.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
If you want UI to reflect bound property updates, you have to bind to a dependency
property or a property in a class that implements (and uses) INotifyPropertyChanged,
always.
How else would the binding target know you changed the property?
John Simmons / outlaw programmer wrote: I never found any reference that said I had to do that.
I bet it's in here somewhere: Data Binding[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well, I wrote a Properties class that implements INotifyPropertyChanged, and it was notifying, but the progress bar wasn't having any of it. Since the XAML editor doesn't know when you spell bound property names wrong, I triple-checked to make sure that wasn't the problem.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Bindings have to have the right source, path, and target.
Don't know what to tell you....I posted a working example...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hi
I have a treeview that gets populated with data. This treeview is on a seperate form that opens up when the app loads, from where the user selects something and after clicking okay he/she continues to the main screen. It takes about 20 seconds for the treeview to get filled, and while this is loading I want to display a progressbar. Is there a way to accomplish this with the BackGroundWorker?
Is there perhaps an easier way?
I also had a look at the Circular Progress Bar from one of Sascha Barber's posts on codeproject, if I can get that progress bar animating only when the treeview gets filled, then stopping again, that would also help a lot.
This is just to be fancy, it's not a requirement for the app I'm doing so I don't want to spend too much time with this.
Thanks in advance for any help
|
|
|
|
|
Etienne_123 wrote: s there a way to accomplish this with the BackGroundWorker
Did you have a look at this[^]?
|
|
|
|
|
Etienne_123 wrote: Is there a way to accomplish this with the BackGroundWorker?
Even the BackgroundWorker Class documentation[^] has sample code...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi All,
I have a ListView populated from an Access table, with each ListView item displaying infromation with several TextBlocks.
I have also placed a CheckBox and TextBox in each item, to collect data from the user.
On a buton click, I would like to collect the value of the checkbox and textbox, and insert it into another table.
I have done similar things in the past using DataList in ASP1.1, but I cannot get WPF's ListControl to work in the same mannor.
Can somebody please send me some code snippets or point me to some good expamles?
Thanks,
Glyn
|
|
|
|
|
Change your thinking round so that you aren't considering the problem from how you get the data from the interface, as this is the wrong place to do it. Instead, think about using two-way binding to update your model, and save your changes from this.
What I would do is create a model that included a boolean field for the checkbox, and a string field for the textbox. When you bind your listview, set up these fields as binding targets using the standard Text="{Binding Path=..., Mode=TwoWay}" and IsChecked="{Binding Path=..., Mode=TwoWay}" syntax. You now have a simple mechanism for tackling this problem.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks for your reply Pete.
Could you please explain how to 'wire' this up properly, as I'm struggling!
In the XAML, I set the TextBox text binding to 'TestText'
<TextBox Name="TextBox1" Width="100" Text="{Binding Path=TestText, Mode=TwoWay}"></TextBox>
At the begining of the code behind, I declared and setup TestText:
Private _TestText As String
Public Property TestText() As String
Get
Return _TestText
End Get
Set(ByVal value As String)
_TestText = value
End Set
End Property
To test it, I used the following code to iterate through the ListView.
Private Sub BtnSubmitValues_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles BtnSubmitValues.Click
Dim row As System.Data.DataRowView
For Each row In ListView1.Items
MsgBox(TestText)
Next
End Sub
The test was meant to produce a seperate message box (for each ListView item), containing the value of each TextBox.
The Message boxes were all blank.
What am I doing wrong?
Thanks
|
|
|
|
|
First of all, I'd implement INotifyPropertyChanged on your class if I were you. Raise the property changed notification in your setter.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
I'm still struggling with this.
I posted the same question in another forum, where it was suggested that I use and ObservableCollection.
Which is the easiest method to implement?
Do you have any code snippets, or know of any similar examples?
Thanks
|
|
|
|
|
An ObservableCollection will only tell you that a collection changed (i.e. that items were added or deleted from it). It won't tell you what changed, and it won't tell you if an individual item changed. That's why you implement INotifyPropertyChanged in your classes.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi there
i can't simulate a page turn in wpf and 3d environment..
(look like british library)
please help me to do it!
|
|
|
|
|
You could always use this[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|