|
hi,how should i use wpf draw staff gauge ?
there's lot of controls, which one is siutable for this condition?
every suggestion will be helpful, thanks a lot!
ICQ:126406887
|
|
|
|
|
it seems like this
0_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_
ICQ:126406887
|
|
|
|
|
Hi,
Just started with my first WPF web browser application.
Can any one tell me if WPF browser applications will run on MAC browsers ?
I am looking to create a website in WPF, just wanted to make sure the cross os browsers compatibility...
A newbie with WPF...
Regards
Vijay V.
Yash Softech
|
|
|
|
|
WPF Browser applications use the .net framework which will only run in windows.
There is a project called Mono[^] which allows you to run some .net applications on other platforms but it currently lacks wpf support.
Silverlight[^] is a subset of wpf which runs on multiple platforms[^].
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
i have an asp.net application which is a website. Now from aspx pages i want to redirect the user to
wpf application in the same window. How can this be done .
|
|
|
|
|
Is this a joke?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I need some helpyin developing the user control. I have developed a usercontrol for slider( which has a slider and a textbox for displaying the value ) , I need to add a user defined property orientation for my slider , based on which it should be rotated . Can anyone throw some light on how to define userdefined properties for the usercontrol.
Thanks
|
|
|
|
|
Namaste, or Vanakkum, or Namaskaram (your choice), Sri Krishnan,
I think you can get some clear responses if you make what you mean by "rotate" and "orientation" a little more clear.
What exactly is it you want to do beyond what setting the Orientation and IsDirectionReverse properties of a WPF Slider at design time do now.
If this is the very simple case of you just wanting to let your code at run-time set the Orientation property : well, write a public method in the UserControl you can call:
public void setSliderOrientation(Orientation whichWay)
{
this.slider1.Orientation = whichWay;
}
If this is the simple case of you wanting to expose the Slider Orientaton property inside a UserControl at Design Time : write a Public Property so that Property will show up in the Property Editor at Design Time :
public Orientation sliderOrientation
{
set { slider1.Orientation = value; }
get { return slider1.Orientation; }
}
If by "rotate" you mean literally rotating the user control itself, or rotating the slider inside the usercontrol : then : just go and take a look at how you can rotate anything in WPF.
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
equivalent method Dispose()(in c#) in WPF?
|
|
|
|
|
It's still called Dispose .
[EDIT] I don't understand why this got a 1 vote. I answered the question accurately. Just because you're using WPF doesn't mean the underlying framework has changed. It's still just .Net and C#.
"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 Sunday, July 26, 2009 3:31 PM
|
|
|
|
|
There - I balanced that out a bit.
"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
|
|
|
|
|
mehdibahadori wrote: equivalent method Dispose()(in c#) in WPF?
Huh!!! WPF is a subset of .Net Framework & it is mainly for the UI. Hence you are using C# as the backend code. So why you are asking about an equivalent method of Dispose() (in C#)??? For your information... there are no alternatives. You have to use the same... which you have to implement from IDisposable interface.
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
|
|
Attached properties need different getters and setters than regular ones...
See the example near the end of this page: http://msdn.microsoft.com/en-us/library/ms749011.aspx[^]
EDIT: Oh, and make sure you really want an attached property here. You might want to use a regular dependency property, then bind it using a RelativeSource with FindAncestor.
|
|
|
|
|
|
Sure... Here's the quick and dirty on both...
Dependency Property = Just a property on a class that automatically updates data binding (At the cost of a little overhead)
Attached Dependency Property = A property that goes down the tree. Think of DockPanel.Dock. It's made so child controls can have a value, but the parent stores them and can act on them. It's most similar to the old ExtenderProviders from WinForms.
As for the binding... Data binding is actually one of the more annoying parts of WPF, but it's great once you get it right. I still have to use references pretty often for the more complicated binding sources...
Every control has what's called a DataContext. This is just any old object you assign to it. It's the source for any data binding. So if you say "{Binding IsValidNewSet}", the first place it will look is in the button's DataContext property. Since it doesn't have one, it'll crawl up the tree and check the Grid's DataContext (Also missing), then the Window's DataContext... It doesn't find one, so you'll have problems.
Now, you COULD set the window's datacontext to itself in the code-behind, so the button would eventually see the Window as its datacontext and get the IsValidNewSet property. It's not the best way though...
The simplest way is to bind by name. Give the window a name in XAML, for example "MyWindow". Then use this binding for the button:
IsEnabled="{Binding ElementName=MyWindow,Path=IsValidNewSet}"
Come to think of it, I was going to post the code for a FindAncestor call, but that might be overkill... I'd say just use ElementName. This overrides the normal behavior and looks at a named element instead of the DataContext.
|
|
|
|
|
|
Ahhh, ok, you're doing this as a UserControl. Then you DEFINITELY want to use FindAncestor instead of ElementName. WPF has some limitations when it comes to XAML-defined UserControls, and those get worse if you start naming their component elements.
You won't run into most of the annoyances unless you start templating, but it's still something to watch out for.
Oh, but the name you define inside the UserControl is an internal name, so instantiating it elsewhere would not override it in this sense.
|
|
|
|
|
|
Heh, well good luck
|
|
|
|
|
|
Ah, ok... I posted another solution above... Looked at your code again, and thought this might be a little much... You nailed it, though.
As for the types.... Well, Window1 is a Window, right? Basically this is saying "Walk up the tree until you find an object that's a Window, and use that as the binding source"
|
|
|
|
|
Rather than do this - use a notification property, as in:
public class NewSet : INotifyPropertyChanged
{
private bool _isValid;
public bool IsValidNewSet
{
get { return _isValid; }
set
{
if (_isValid != value)
{
_isValid = value;
OnChanged("IsValidNewSet");
}
}
}
protected virtual void OnChanged(string propertyName)
{
PropertyChangedEventHandler handler = propertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName);
}
}
public event PropertyChangedEventHandler PropertyChanged
{
add { propertyChanged += value; }
remove { propertyChanged -= value; }
}
private event PropertyChangedEventHandler propertyChanged;
} Then, set this up as your DataContext , e.g. in Window1 (probably just after you call InitializeComponent() ), set your DataContext to an instance of this class.
Finally, in your XAML, all you need do is bind to this item using:
<Button IsEnabled="{Binding IsValidNewSet}" />
"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
|
|
|
|
|
|