|
|
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
|
|
|
|
|
|
Has anyone tried to get silverlight 3 to work with Blend 2?
|
|
|
|
|
No - I've used Blend 3 instead (the RC) - if you've got MSDN, Blend 3 RTM is available to download now.
"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
|
|
|
|
|
I do and when I checked it wasn't there, like 2 days ago. I see it's there now so thanks.
|
|
|
|
|
Pete O'Hanlon wrote: if you've got MSDN, Blend 3 RTM is available to download now
Thanks! That slipped under my radar
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
We need to host MS Office applications(integrate) in WPF. I tried web browser but that supports only PDF hosting.
Then there is DSO Framer control, but that uses Windows host as root element. There we loose some flexibilty(Like dynamic resizing of window etc.).
Is there a better way out
Thanks
|
|
|
|
|
amit_1986 wrote: I tried web browser but that supports only PDF hosting
No it doesn't. It's just a standard web browser - if you can open your document in IE, you can open it in the web browser component.
"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
|
|
|
|
|
I have a bunch of 3D models that gets rendered on startup. I can easily select any model using Hit Testing. My question is, how can I rotate the selected model using the directional keys on the keyboard?
|
|
|
|
|
Set a RotateTransform3D on your model and implement a command handler that works out which key was pressed and updates the transform as appropriate.
"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,
We have a web server which sends data to online application and client wpf application to render some controls.
The dimensions of controls is set by server in pixels. Controls are rendering fine in online application, but in client wpf application controls are rendering with very small dimensions. Is there any conversion factor to render wpf controls using pixels dimensions which work just fine for web application?
Any help will be useful.
Thanks
|
|
|
|
|
|
Collin Jasnoch wrote: Is it possible to have a template in a library and use it in my app?
If so how do I find it and use it?
There's a variety of methods. Understanding how WPF uses
resources may help you choose an appropriate solution...
Resources (WPF)[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
When I am trying to access the RSS feeds from silver light I am getting System.Security. Security Exception. For resolving this I places crossdomail.xml and clientaccess.xml files in my application and tries. But they didn’t worked and I am getting the same error for some websites.
If anyone have any idea how to use them or place them in an Silverlight application please reply me. Please reply me soon. Its urgent.
Thanks in advance.
|
|
|
|
|
If you are accessing the feed which is outside of your website then crossdomain.xml and clientaccesspolicy.xml should be hosted on that sites.
For example:
Your Silverlight website is http://mycoolsilverlight.com and the feed that you are accessing is http://anotherwebsite.com. So, you should be able to access
http://anotherwebsite.com/crossdomain.xml or http://anotherwebsites.com/clientaccesspolicy.xml
Hope it helps.
|
|
|
|
|
I have a lot of Services running.
And all of them are written in sync way.There is no async operation pattern at all.
Silverlight 3.0 client is one of many clients for this services.
All other clients work pretty well with sync operations.
I have to generate SL proxy for this services.
I do not want to use AddServiceReference.
I want to use ChannelFactory to create proxy.
When i write ChannelFactory<IServiceRegistrar> cf = new ChannelFactory<IServiceRegistrar>(new BasicHttpBinding(),
new EndpointAddress("http://localhost:5545/Registry"));
i have exception saying that IServiceRegistrar contract does not support async pattern.
How can i create proxy for sync wcf service contract manually in SL?
|
|
|
|
|
pioner wrote: all of them are written in sync way
What do you mean by "all of them are written in sync way"? what is "sync way" in writing the web services?
Having sync or async method is totally depend on how you generate the proxy class.
All versions of Silverlight don't support "Sync" calls because Microsoft doesn't want the browser to be freezed. So, all calls to Web services must be "async" calls.
Hope it helps.
|
|
|
|
|
pioner wrote: How can i create proxy for sync wcf service contract manually in SL?
It doesn't matter if the service operation is implemented sync or async on the server.
Silverlight is on the client end independent of the server, and service operations
MUST be implemented async in Silverlight. That means specifying AsyncPattern=true
on your OperationContractAttributes and implementing your interface methods with the
BeginOperation/EndOperation pattern.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: That means specifying AsyncPattern=true
on your OperationContractAttributes
It's not really necessary to apply this attribute in OperationContractAttributes. You can just tick "async" when you are generating proxy.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
Michael Sync wrote: You can just tick "async" when you are generating proxy.
Right. The OP specified "How can i create proxy for sync wcf service contract
manually in SL?" so I assumed (s)he was doing it manually.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks, Mark.
If I remember correctly, SVCUtil.exe can't be used for generating the proxy class for Silverlight from command-line. It wasn't supported until Silverlight 2 release. (but there are some workarounds like that "link[^]" )
I will check whether we can generate the proxy class for Silverlgiht from commandline in Silverlight 3 or not.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|