|
ghumman63 wrote: i need to mark it with datacontract attribute
As Pete said. You mark the class with a DataContract attribute when you are sending the object through WCF from host to client or from client to host. When the object is sent from one to the other, the object is serialized when sent, and deserialized when it gets to it's destination. The DataContract tells WFC how to serialize the object and how to deserialize it.
In your example, you are directly instatiating the class not deserializing it.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
You can use them directly, but you need them if you want to marshall them "over the wire" using the internal WCF communications layers. Basically, these define parts of the Contract, which forms part of the basic tenet of WCF:
A = Address
B = Binding
C = Contract
Or, to put it another way; A = where the service is hosted; B = the mechanism you're going to use to communicate with it and C = the data and methods that you are going to interact with on the service.
"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 meean to say , i didnt use datacontract attribute but still i can
deserialize my objects at my client by just adding the reference of my domain DLL like
dim emp as employee = Servicereference.GetEmployee("staffno")//client code
in my wcf service class employee is not marked as datacontract , thats why i am confused that
in which case i need to mark it with datacontract attribute.
thanks in advance. nkh
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
hi guys
i am very much new to WCF , actually the issue is that i have a seperate dll for my domain objects named "MYDomainObjects" , i add a reference into my wcf services and create a method which returns
object of type of Employee which is a class in ""MYDomainObjects",
on client i create a wpf client and add a reference to my ""MYDomainObjects""
and call the method and get values into my client side Employee object , but i am confued where
is now datacontract and data member , because it is said that we have to use data contract for our
complex types to be serialized ,, i hope you will understand my concern , thanks in advance ...
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
I used image-gallary download form codeplex.com on my project. It was very very slow to open a picture. I did same throught flash, it is much faster.
Can any body tell me how to speed up silverlight application to better than flash as it can get data of my asp.net and process it, flash is harder to work for such manner. I want to use silverlight because of easily support with c# and asp.net
|
|
|
|
|
There's no reason Silverlight should be significantly slower than Flash
opening a picture.
Without any details on what you're doing, it's difficult to help
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have 10 pictures. I created thumbnails of all, now I have 20 pictures.
I used Data.xml file for path containing full-size and thumbnail pictures. Configuration.xml file for settings [These files I got automatically from codeplex.com Image Gallery Project].
I created Gallery, you can view at: http://www.trannumdigitalstudio.com/[^]
Also you cn view flash Gallery at: http://www.flashgallery.org/demo.html[^]. Here image size is bigger still faster
All images in Silverlight Gallery are at 72 dpi, 500*500 px resolution
|
|
|
|
|
I'm not sure what you are seeing.
The Silverlight gallery loads and shows images faster than the
flash one for me.
Once the images are cached (have been viewed) they load instantly.
Note I'm using Firefox 3.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I don't know anything about silverlight but I am using firefox 3 and the silverlight page was really slow compared to the flash page.
I didn't get any requirements for the signature
|
|
|
|
|
|
I have a combobox where the ItemsSource is bound to a ObservableCollection<string> and the SelectedItem is bound to a string DependencyProperty.
The ObservableCollection<string> is populated so that the first string is an string.empty, so that something by default is not selected.
My problem is this, if I select something in the combobox beside the string.empty (by clicking the drop down arrow and left clicking on an item, you can click the drop down arrow and select the string.empty item. However you can use the scroll on the mouse and select the string.empty. Then the caveat is that you can not scroll with the mouse to something that is not string.empty, you have to hit the drop down arrow and select an item with a left mouse click.
Any ideas, this has me stumped.
|
|
|
|
|
babongita wrote: the SelectedItem is bound to a string DependencyProperty.
What does this binding look like?
I can't reproduce the problem if this binding is left out.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
<ComboBox x:Name="cboDistrict"
IsSynchronizedWithCurrentItem="True"
Grid.Column="1"
Grid.Row="0"
Style="{DynamicResource BaseComboBox}"
TabIndex="20"
ItemsSource="{Binding Path=AllDistricts, Mode=Default}"
SelectedItem="{Binding Path=BodyTextDistrict, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding }"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
|
|
|
|
|
I took your scenario and binded by creating the dependency property, for me everything works. Once the mouse is over the combo box and combobox has the focus , scrolling works fine with the mouse. you can only post a sample so that actual issue can be observed
<ComboBox x:Name="cboDistrict" IsSynchronizedWithCurrentItem="True"
Grid.Column="1" Grid.Row="0" Style="{DynamicResource BaseComboBox}"
ItemsSource="{Binding Path=AllDistricts, Mode=Default}"
SelectedItem="{Binding Path=BodyTextDistrict, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding }"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
Private Property AllDistricts() As ObservableCollection(Of String)
Get
Return DirectCast(GetValue(AllDistrictsProperty), ObservableCollection(Of String))
End Get
Set(ByVal value As ObservableCollection(Of String))
SetValue(AllDistrictsProperty, value)
End Set
End Property
Public Shared AllDistrictsProperty As DependencyProperty = _
DependencyProperty.Register("AllDistricts", GetType(ObservableCollection(Of String)), _
GetType(NameView), New UIPropertyMetadata(New ObservableCollection(Of String)))
Public Property BodyTextDistrict() As String
Get
Return Convert.ToString(GetValue(BodyTextDistrictProperty))
End Get
Set(ByVal value As String)
SetValue(BodyTextDistrictProperty, value)
End Set
End Property
Public Shared BodyTextDistrictProperty As DependencyProperty = _
DependencyProperty.Register("BodyTextDistrict", GetType(String), _
GetType(NameView), New UIPropertyMetadata(String.Empty))
|
|
|
|
|
I don't know what it means. It's XAMLParseException :
Cannot convert the value in attribute 'Style' to object of type 'System.Windows.Style'. Specified element is already the logical child of another element. Disconnect it first. Error at object 'buttonPushPin' in markup file 'CometWPF2;component/controlcrm.xaml' Line 42 Position 23.
Here's the offending code:
<ToggleButton Style="{DynamicResource UDPPushPinButton}" Name="buttonPushPin"
Width="26" Height="23" Margin="0,0,19,0" HorizontalAlignment="Right" VerticalAlignment="Top"
BorderThickness="0" Background="Transparent" BorderBrush="Transparent"
ToolTip="Pin this tab" />
More Info: This button is in all of the tabs in a tab control, and this error occurs when more than one tab (with the button) is added to the tab control. The tabs all contain a UserControl that has the button 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
modified on Wednesday, April 15, 2009 9:17 AM
|
|
|
|
|
Set x:Shared="false" for this. This creates a unique instance instead of a static instance.
"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
|
|
|
|
|
No workee. I also tried putting that on the style itself.
"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
|
|
|
|
|
Do you want to send it to me and I'll have a look? You've got my email address.
"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
|
|
|
|
|
Let me see if I can cut it down to a minimal project.
"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 very slimmed down app that duplicates the behavior. I'll have to wait until I get home tonight to send it to you.
"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, I got it not to crash by doing this:
<ImageBrush x:Key="PinUpBrush" ImageSource="/WpfTest;component/Icons/blue_pushpin.png" />
<ImageBrush x:Key="PinDownBrush" ImageSource="/WpfTest;component/Icons/red_pushpin.png" />
<Style TargetType="ToggleButton" x:Key="UDPPushPinButton2" >
<Setter Property="Button.Background" Value="{StaticResource PinUpBrush}" />
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Button.Background" Value="{StaticResource PinDownBrush}" />
</Trigger>
</Style.Triggers>
</Style>
Now all I gotta do is figure out how to make the border not show up when I click 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
|
|
|
|
|
John Simmons / outlaw programmer wrote: Now all I gotta do is figure out how to make the border not show up when I click it....
That will be in the control template. Here's the default template ripped from
a control on Vista:
<Style x:Key="ButtonFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#F3F3F3" Offset="0"/>
<GradientStop Color="#EBEBEB" Offset="0.5"/>
<GradientStop Color="#DDDDDD" Offset="0.5"/>
<GradientStop Color="#CDCDCD" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
<Style x:Key="ToggleButtonStyle1" TargetType="{x:Type ToggleButton}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" RenderDefaulted="{TemplateBinding Button.IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
</Microsoft_Windows_Themes:ButtonChrome>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#ADADAD"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I am using clr 3.5 for asp 2008. My aim is to enter daily task and to save it in that day's month view. WebMonthView control seems not to have any click events. The data i am adding for a particular date should be visible in that day in MonthView Control. Any Idea ? Pls help me urgent!!!
Gomathi R
|
|
|
|
|
Wrong message board!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Then, this question comes under which board? It is silver light control only na?
Gomathi R
|
|
|
|