|
Hi,
I'm trying WPF and databinding....and I've run into a simple(I suppose) problem. Hopefully someone cam point me in the right direction.
If I declare a double like this i window.resources:
<System:Double x:Key="myValue">10</System:Double>
How can I bind a textboxs textproperty to it?
|
|
|
|
|
Here's a sample:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib"
>
<Page.Resources>
<System:Double x:Key="myValue">10</System:Double>
</Page.Resources>
<Grid>
<TextBox Text="{Binding Source={StaticResource myValue}, Mode=OneWay}" />
</Grid>
</Page>
"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
|
|
|
|
|
Thank you very much, but how about TwoWay binding? Why doesnt that work? If I create a simple class and have a property of type double and bind to that property it works fine.
|
|
|
|
|
It won't work in this sample because you don't have a variable backer to bind into - it's a StaticResource. If you had a variable the two way binding would work.
"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
|
|
|
|
|
Hmmmm....I've probably missunderstood something here....
I thought that I declared a variable, but it looks lite I can treat these declarations as "const"s....
How about DynamicResource, can I use that instead?
|
|
|
|
|
hi all,
with Silver3.0 can we use managed VC++ Dll or C# Dll as we can can use in WPF
using HndHost??
Thanks in Advance
Samir Satardekar
|
|
|
|
|
The requirements will be the same - you can use any .NET assembly
that targets the Silverlight .NET framework library.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Sir Mark,
I have created a Dll using VC++ and build it with clr option. i add the following lines
to access it in my C# forms
namespace a
{
public ref class b
{
public: void funccall()
{
//call to class
}
}
};
can i use this dll in my silverlight project??
i have tried the convert .net assembly to silverlight Assembly
Converting .NET Assemblies to Silverlight Assemblies[^]
This does work for VC# dlls but fails for VC++
Thnks in Advance..
Regards
Samir
|
|
|
|
|
In theory you could use a C++/CLI DLL in Silverlight but you'd
have to do the following:
Compile with /clr:pure
Eliminate all references to .NET framework assemblies
Only reference Silverlight framework assemblies
Eliminate any use of the CRT (C runtime)
At that point you essentially have C# so you're not getting any benefit from C++.
Even if you do all of the above, I've heard it still won't work properly
because the MSIL produced by the C++ compiler has some incompatibility with
the Silverlight "runtime".
Give it a try if you want, but it's currently not supported.
Just use C#
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I want to know the Exact use and purpose of Windows Workflow Foundation?
i gone through many articles, in that they explain their own examples only but no one describe about WF and WF uses.
Please Explain Purpose of WF.
Please dont give links, In that they explain with an example only.
Thanks In Advance.
--Naren
|
|
|
|
|
Like its bastard cousin (WPF), it's main purpose is to slow development to a crawl while you search in vain for answers to your inevitable questions. If and when you ever get your application finished, its secondary purpose kicks in, obfuscating the programs intended purpose and making maintenance more difficult because Microsoft abandoned the framework soon after introducing it (like they're doing to LINQ, and soon, WPF).
"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
|
|
|
|
|
John Simmons / outlaw programmer wrote: because Microsoft abandoned the framework soon after introducing it (like they're doing to LINQ, and soon, WPF)
Where did you read that?
Kevin
|
|
|
|
|
I read a blog somewhere today that said Microsoft was pushing silverlight and would soon abandon WPF.
Don't ask me where, because I don't recall (and thought it was kind of absurd myself).
"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 know I don't have to state this, but I will anyway -
Silverlight can't replace WPF - they aren't even the same "technologies".
So your frustrations with learning a new framework (which I bet you'll soon
find much more flexible than Windows Forms) has led you to rehashing garbage
you read on the internet?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I tend to lash out at any moving object when I'm pissed off.
Of course, I know that silverlight can't replace WPF, but we all know about Microsoft's tendency toward platform/framework/paradigm abandonment, so I figured I'd ping on it.
"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
|
|
|
|
|
Well, they almsot certainly won't be abandoning LINQ anytime soon. It's part of the core languages. Maybe you're thinking of Linq to SQL vs. Linq to Entities?
As for WF, it is being pushed out to more and more products. Whether anyone is using it or not is another matter.
However, WF and WCF are becoming more intertwined and the new Oslo modelling platform is heavy on WF. My impression is that WF is intended to be analogous to WPF/Silverlight in the following way.
WPF/Silverlight is intended to allow easier partition of work between developer and designer.
WF is intended to allow easier partition of work between developer and business analyst.
There is an Oslo whitepaper that provides an illustration of this scenario.
Kevin
|
|
|
|
|
|
Hi Naren,
WF deals with two kinds of workflow models:
1. Sequential workflow
2. State machine workflow
The main benefit is to visualize your design, because in WF, your workflow diagram (either flowchart or state diagram) is your code. It's easier to change and to document. Every time when you change your diagram, your code will be changed automatically. This way, you can focus on important logical design without having to deal with detailed issues.
Hope this helps a little bit.
Jie
|
|
|
|
|
hi,
i added a windows application to my WF solution. that application i already done with c#.net.
now i have to do the same again in WF? or no need?
because we have to show flow through win forms also.
Thanks & Regards
--Naren
|
|
|
|
|
Hi,
I created one wpf application and published it. When i run it from another system thar doesn't have Dotnet framework installed, it show me an error(Prerequisite- dotnet framework 3.0 &Windows installer). Any idea regarding this.
Gomathi R
|
|
|
|
|
You could deploy it using ClickOnce, which would download the relevant framework, or you could add the framework in as a required resource into the installer for your project, or you could supply the link for the user to download and install the framework.
"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
|
|
|
|
|
Hi,
I selected framework as a required resource. But even then the error appears.I created setup. but if we run it using the setup the UI gets collapsed.
Gomathi R
|
|
|
|
|
GomathiR wrote: if we run it using the setup the UI gets collapsed.
I'm not sure what that means. If you're having trouble with the deployment, use ClickOnce and let the user download your application from a central server.
"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
|
|
|
|
|
Install .net - I mean if it's a .net application then you're going to need .net installed
|
|
|
|
|
To run applications developed in WPF, u need to install the .NET framework which is available for download. U must download and install it on the target computer to make your application run.
|
|
|
|