|
Hi,
I have a problem using DataContractSerializer.
My Silverlight application asks for a web page that return an object serialized using DataContractSerializer.
When I try to deserialize the data, I obtain an empty object:
the object itself isn't null, but all the properties are set to "" for the strings or the arrays contain zero elements.
What can I do to solve this?
|
|
|
|
|
Hello everybody
I realy need help!
I have an custom multiscale image made with DeepZoom and I edit the source with Visual Studio 2010! The multiscale image it contains World map!
All I want to do is to add a custom PushPin into the map and when I move the map PushPin-s to save the position on the map!
Any ideas?
Thanks
|
|
|
|
|
|
I have the exact same problem
|
|
|
|
|
I can get all control on form in C# Windows Form App by "Control.ControlCollection coll = this.Controls"
Is there any simalar way in WPF to perform this task?
Any help would be appreciated
|
|
|
|
|
|
HI All,
DataTable data i binded to the comboBox, All values are coming correctly when i expand the combobox but after selection combobox item is coming as "System.Data.DataRowView". What's the problem. Please help me.
Sorry for my english.
Thanks in advance.
|
|
|
|
|
You need to set the DisplayMemberPath property.
|
|
|
|
|
I already set DisplayMemberPath in .cs, below is my code:
DataTable dt = new DataTable();
dt = objConnections.getAllDBNames();
cmbDBName.DataContext = dt;
cmbDBName.DisplayMemberPath = dt.Columns["name"].ToString();
cmbDBName.SelectedValuePath = dt.Columns["name"].ToString();
cmbDBName.SelectedValue = dt.Columns["name"].ToString();
in XAML:
<ComboBox x:Name="cmbDBName" Grid.Row="1" Grid.Column="1" ItemsSource="{Binding}" SelectionChanged="cmbDBName_SelectionChanged" Margin="1,7,1,5.723" Style="{StaticResource ImageComboBox}"/>
|
|
|
|
|
Suppose I have a form like this http://www.mediafire.com/i/?7ojbjfc66aazg2o[^]. The GroupBox and Button A control contain the red point. When I click the red point, I want to get the GroupBox and Button A control, but not Button B control. The Button A is “smaller” than the GroupBox. And the control I expected when I click the red point is Button A (the smallest control).
In fact, I can getRecangle of each control to solve my problem, but it’s slow down the performance. I need a better way to increase performance.
Here is my question: is there any WPF functions help me do that?
Thank you.
|
|
|
|
|
This tip/trick might help you:
Get Mouse Click Relative Position[^]
It was written for Silverlight, but I see no reason it shouldn't work for WPF. Even if it doesn't work, you can probably get a direction as to where to look for a WPF-oriented solution.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
modified on Friday, August 20, 2010 2:46 PM
|
|
|
|
|
Hi John Simmons,
I can get all controls from one point by calling this function "Control.IsMouseOver".
Anyway, thank you very much.
|
|
|
|
|
Hi.
Is there an easy/right way to make the same project both in WPF and Silverlight?
Thanks.
David
|
|
|
|
|
For the most part, if it works in Silverlight then it'll work in WPF. Silverlight is missing some features of WPF, and has tighter security, so it's mostly a subset.
There ARE exceptions, and some third-party controls will only work with one or the other, but will often have a version for each.
EDIT: Basically, aim for Silverlight and keep an eye on any non-framework controls you use (Including the Silverlight Toolkit).
|
|
|
|
|
Thanks Ian.
After completing the Silverlight project how I convert it into WPF? I am a GUI Designer and working mostly with Expression Blend. Or I have to do it with Visual Studio?
Thanks,
David
|
|
|
|
|
Don't think I can help ya there... I tried Blend once, and never went back to it. Felt like I was programming in Photoshop.
|
|
|
|
|
Could you describe in short how you do it in VS?
Thanks,
David
|
|
|
|
|
If you didn't use any third party controls, most of what you have in Silverlight can be used without changes in WPF. Of course, there are differences, and there's no possible way we can list them all here.
I know you're gonna think this sounds harsh, but be a programmer, and work it out.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
Why harsh, on the contrary, very simple:
1. Change the output type of the Project to Windows Application.
2. Replace the agclr.dll reference with references to PresentationCore.dll and PresentationFramework.dll.
3. Your main XAML window will inherit from System.Windows.Window, not Panel.
4. In your Window XAML declaration, you'll need to change 'xmlns="http://schemas.microsoft.com/client/2007"' to 'xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"'
5. Another option is to create a new WPF project and copying your code into it. I can't tell you which would be easier or more efficient.
6. Of course, some things will be likely be broken, but they should be minimal and easily fixed.
Enjoy your life
|
|
|
|
|
Ian Shlasko wrote: any non-framework controls you use (Including the Silverlight Toolkit).
From that I am assuming the Silverlight toolkit does not work with WPF.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Prism (Composite Application Lib) allows multi targeting of both WPF and Silverlight....has some good how-tos also
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Hello
I can not work out how to find a objects ancestor in the following context.
I have a Tab control which has three Tab Items a, b and c. Each Tab Item has a frame which in turn hosts a page. Each Tab Item will host the same page.
The page contains a canvas with custom built graphical objects all inheriting framework element. I would like to make the visibility of my graphical objects dependent on the Tab Item.
For example if the page finds its ancestor of type Tab Item , name property to be "b" then only certain objects would be made visible. At initialization of the object i would like to look up the ancestor tree till i reach type Tab Item and then compare the Tab Item name to another object property and then set the visibility property.
Thanks
Dane,
|
|
|
|
|
You didn't mention whether it was WPF or Silverlight. In WPF, you can use the VisualTreeHelper object. It exists for Silverlight as well, but I think it's less capable.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
Hmm... Off the top of my head, I think this could be solved with a couple attached properties...
Not sure how familiar you are with them, but attached properties in WPF are basically properties that are based on one class, but can actually apply to any DependencyObject of a given base type. They're most similar to the IExtenderProvider functionality in WinForms, except that they can ALSO inherit to child objects... So if you set the value on the TabItem, then all of its children can read that value too, as if it was on each of them.
1) Create two attached properties:
- a) ParentTabName, with a type of TabItem. For each tab, bind that property to the tab name ({Binding TabName,RelativeSource={RelativeSource Self}} if memory serves).
- b) TabVisibilityCodes, with a type of string. For each child control that needs to be shown/hidden, set that property to, say, a comma-delimited list of the names of tabs it should be shown on. All of this can be done in XAML once the properties are created.
2) In the setter for either property (The getters/setters are all in one place, not on each object), compare the two attached properties for the element in question, and update its visibility accordingly.
|
|
|
|