|
Yes pretty much.
I've had a look at the post, looks interesting. Would you be able to give me pointers to how this would work in my sample?
Obviously I have the PropertyObserver class now. In my viewmodel would I do something like:
PropertyObserver<IService> _observer = new PropertyObserver<IService>(MyService).RegisterHandler(w => w.ErrorStatus, w=> ErrorChanged(w.ErrorStatus));
private object ErrorChanged(ErrorStatus errorStatus)
{
throw new NotImplementedException();
}
|
|
|
|
|
That looks about right to me.
|
|
|
|
|
I seem to get this error:
Error 2 The call is ambiguous between the following methods or properties: PropertyObserver<IService>.RegisterHandler(System.Linq.Expressions.Expression<System.Func<IService,object>>, System.Action<IService>)' and PropertyObserver<IService>.RegisterHandler(System.Func<IService,object>, System.Action<IService>)
|
|
|
|
|
If you can put your project on DropBox, I'll download it tonight and have a look at it.
|
|
|
|
|
Ok figured it out. In my frantic attempts to get it working I must have generated a method stub in the PropertyObserver class. This is why I was getting the error.
Thanks for your help Pete.
|
|
|
|
|
No problem. I'm glad you've got it working.
|
|
|
|
|
after put the control in wpf with winform, winform control in wpf control to cover
What is the reason, should I do?
picture
|
|
|
|
|
I'm sorry, but I'm not clear what you're asking. I've looked at the picture and I can see that you have airspace issues there - is this what you are asking about? An airspace issue is where you try to overlay Winforms and WPF rendering or a web page and WPF rendering.
This is a known issue with WPF (and will be fixed in the next release of WPF) because you are trying to combine rendering stacks - the fix is not to use a Windows Forms control. Find a WPF one that does what you want and use that, or write one yourself - it's generally not that hard.
|
|
|
|
|
There is a workaround which can be used to avoid this issue
You need to wrap the WinformHost with UserControl of WPF.
Follow these steps
1. Create a user control in the WPF (lookless control)
2. Create a style for this control
3. In the template of the style add WinformHost with x:name
4. Now override the OnApplyTemplate() of this control
5. Provide the .Child property of the Winformhost, added in the control
template to the actual winform control that you want to display.
Wrapping the winform control in the WPF control will avoid overlapping the WPF controls.
This overlapping is due to difference in the mechanism for rendering control in WPF and Winforms.
Winforms: uses GDI+ for rendering
WPF: uses DirectX for rendering
Hope this will help you to solve your problem
Happy Coding
modified 30-May-12 0:49am.
|
|
|
|
|
HI All
I want to use DirectShow in silverlight to capture video from webcam . Can any one suggest me the solution .Share some url for reference
cheers
|
|
|
|
|
The original DirectShow framework cannot be used with Silverlight.
This version[^] might help you.
Warning: I have never used this nor have a clue how it works, so I'm not sure how / what the results would be.
|
|
|
|
|
Thanks for your support.
I know it!i want a sample code project plz
|
|
|
|
|
If you want sample code, use Google or Bing and search for some. That's what we would do.
|
|
|
|
|
hey guys
im using pointer in my silverlight application in unsafe mode.
i checked Requested elevated trust when runnig in browser,add registry key AllowElevatedTrustAppsInBrowser and
signing the xap file.but when i executing my application it crashe with exception :Operation could destabilize the runtime"
Please help me to solve it.
Cheers
|
|
|
|
|
I have 2 questions...
I created a HierarchicalDataTemplate which is bound to a NodeModel
[Serializable]
public class NodeModel : ViewModelBase
{
public Guid Id { get; set; }
public string Caption { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public ImageSource Image { get; set; }
public bool IsExpanded { get; set; }
public string FileName { get; set; }
public NodeType Type { get; set; }
public List<NodeModel> Children { get; set; }
}
the template:
<HierarchicalDataTemplate DataType="{x:Type models:NodeModel}"
ItemsSource="{Binding Path=Children}">
<StackPanel Orientation="Horizontal"
Margin="2">
<Image Source="{Binding Image}"
Height="16"
Width="16"
Margin="0,0,2,0" />
<TextBlock Margin="0,0,5,0">
<Hyperlink NavigateUri="{Binding Caption}"
Foreground="#0C2DAA"
Command="{Binding Path=DataContext.SelectedLinkCommand,
RelativeSource={RelativeSource FindAncestor,
AncestorType={ x:Type views:ProjectListView}}}">
<InlineUIContainer>
<TextBlock Text="{Binding Caption}" />
</InlineUIContainer>
<Hyperlink.Style>
<Style TargetType="Hyperlink">
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="False">
<Setter Property="TextDecorations"
Value="{x:Null}" />
</Trigger>
</Style.Triggers>
</Style>
</Hyperlink.Style>
</Hyperlink>
<TextBlock.ToolTip>
<ToolTip>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock FontWeight="Bold"
Text="{Binding Path=Caption}"
Grid.Row="0"
Margin="0,0,0,3" />
<TextBlock FontStyle="Italic"
Grid.Row="1"
Text="{Binding Path=FileName}"
Visibility="{Binding FileName,
Converter={StaticResource StringToVisConverter}}" />
<TextBlock Text="{Binding Path=Description}"
Grid.Row="2"
Visibility="{Binding Description,
Converter={StaticResource StringToVisConverter}}" />
</Grid>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</StackPanel>
</HierarchicalDataTemplate>
Finally, the treeview this is used in:
<telerik:RadTreeView x:Name="tvwTreeData"
ItemsSource="{Binding Path=Folders}"
ItemContainerStyle="{StaticResource ItemContainerStyle}"
SelectedItem="{Binding Path=SelectedTreeItem, Mode=TwoWay}" />
Problem 1) When I click a hyperlink, the correct tree node is not always selected. In other words, to make it work right I have to click the node, then the hyperlink on that node. How can I adjust this so that clicking a link selects its node?
Problem 2) How can I adjust this template so that nodes of Type.Folder don't show the hyperlink?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
This can be achieved by using the style template and DataTriggers (will give you the sample code). Before that, I am not sure why you want to use the Hyperlinks inside the TreeNode. Could you please help me to understand its need.
This will help me to give you the answer!
Happy Coding
|
|
|
|
|
You should not disrespect the other people, Or you should not ask the questions if you don not want to get the answer...
Happy Coding
|
|
|
|
|
Amardeep Deshmukh wrote: You should not disrespect the other people
What? What the hell are you talking about?
Amardeep Deshmukh wrote: Or you should not ask the questions if you don not want to get the answer...
Where did this come from???
If it's not broken, fix it until it is
|
|
|
|
|
Kevin,
I was trying to help you out and asked couple of questions to understand the problem statement better. I worked a lot on Hierarchical data and thought could help you. But, instead of replying and clarifying the problem you down voted my reply...
Also, I noticed that in one of the question from the C# forum (licensing related question) without understanding the answer provided you directly replied to it saying this will not work.
That's why I replied to you post...
Sorry if I hurt you sentiments
Happy Coding
|
|
|
|
|
Amardeep Deshmukh wrote: But, instead of replying and clarifying the problem you down voted my reply
How do you know it was Kevin? Never assume that you know who downvoted you. Currently only Code Project staff can identify that information. This is one of the reasons that revenge univoting is never a good idea.
|
|
|
|
|
|
Your first question does not make sense!
The image you link to is for a demo app with exactly what you asked for. A forum message cannot give you as much information as a demo article. Work through the article and when you have a specific question about the code then ask!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hey folks, regarding CS6, I was wondering, if anyone is considering subscription pricing, and if so are you thinking in month-over-month of yearly subscription , and what may be the reason for this. Also wondering if anyone can share their experience using Adobe's creative cloud. Will appreciate any advice you may have
|
|
|
|
|
I refer you to the answer I gave you the last time[^].
|
|
|
|
|
I want to use Localization in silverlight . Can any one suggest me the solution .Share some url for reference
Regards,
Shirish
|
|
|
|