|
I would create a VM for the UC. The parent VM then instantiates the child VM and has a reference to it so can access it's methods.
So any other control that needs to use the UC can instantiate its VM and Bob's your uncle.
PooperPig - Coming Soon
|
|
|
|
|
Generally, I write controls with code behind. Making a VM for a reusable control kinda ties you into an MVVM framework. I like to re-use my controls across apps.
|
|
|
|
|
I want to send a fax using wpf. using rdlc report can we send a fax or not. Thanks in advance
modified 25-Jul-14 5:47am.
|
|
|
|
|
|
Pete O'Hanlon wrote: Use TAPI.
Don't you need a hmm what is that thing, oh yeah a modem to use that.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You can Google it using the term "sending fax using C#".
They'll provide you with a code or a tutorial and you can then use it in your software.
Favourite line: Throw me to them wolves and close the gate up. I am afraid of what will happen to them wolves - Eminem
~! Firewall !~
|
|
|
|
|
Hi
I have created a class called DatePickerEx.cs that inherits from DatePicker class. Then I created a UserControl called CustomDatePicker.xaml that references the DatePickerEx.cs class in the xaml code.If I bind the "selecteddate" property in xaml at this point, it works good. So far so good.
Now, I reference the CustomDatePicker.xaml usercontrol inside another UserControl, at this point I have no way to set the "SelectedDate" property on the new UserControl called CustomDatePicker.xaml, can someone explain me how can I expose the DatePickerEx.cs->DatePicker.cs SelectedDate property via the new userControl CustomDatePicker.xaml to any other consumers of CustomDatePicker.xaml.
I need to use some kind of Dependency Property to achive this?
Your help will be highly appreciated.
Thank you.
happy coding!
|
|
|
|
|
If you did public class DatePickerEx : DatePicker, then you'll get all the public properties and methods of DatePicker. If that's not working, you did something wrong . Not sure what since you didn't post what errors you are getting or any code.
|
|
|
|
|
in my application WPF/C# , i have a simple TreeView "treview1" that content for exemple:
*item1
* item1.1
*item2
* item2.1
Now i have an Class "Search.cs", and within this Class i have some methods like: advanced_serch and simpl_search , I want to be able to modified my TreeView in this two methods(advanced_serch and simpl_search).....
How i can dos this???
Please help me !!
|
|
|
|
|
What do you expect your searches to do (other than find a node label)?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
for exemple, in my Advanced_Search i want to upadate My TreeView( delete or add items).
|
|
|
|
|
Mouaici Mohamed wrote: Advanced_Search i want to upadate My TreeView( delete or add items). That makes no sense, search implies finding something, not modifying the data.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am attempting to create a common WPF logon dialog. I have the dialog as a separate DLL which access a service and returns the user permissions. This works except the dialog displays as an independent window. I want to pass the main window to the dialog as the owner.
I call the logon dll from the main viewmodel
public void ShowLogon()
{
new IFALogon.LogonDlg().DoLogon(MainUI.AppID, "Finance NPA");
if (IFALogon.LogonVM.DBUser == null)
{
Exit();
}
else
{
}
}
How can I pass the main view to this DLL.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
In a WPF application, you have global access to the main window through the static Application.Current.MainWindow.
|
|
|
|
|
That did the trick, I now have a DLL that can be used to authenticate and authorise all our WPF apps. Thank you!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have a Treeview (telerik) using HierarchicalDataTemplate
<telerik:RadTreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
<Border Background="{Binding BackColour}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding ImageSource,Converter={StaticResource ImageFromAssetsConverter}}"
Width="16"
Height="16" />
<TextBlock Margin="10,0"
Text="{Binding NodeLabel}"
TextWrapping="Wrap"
VerticalAlignment="Center" />
<CheckBox IsChecked="{Binding IsChecked,Mode=TwoWay}"
Content="Default N/A" Margin="15,0,0,0"
Visibility="{Binding ShowCheckBox,Converter={StaticResource VisibilityConverter}}" />
</StackPanel>
</Border>
</HierarchicalDataTemplate>
</telerik:RadTreeView.ItemTemplate>
The user MUST select the node BEFORE checking the checkbox. Is it possible to select the node when the user checks the checkbox.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes. Add a trigger to the TreeViewItem that says if IsKeyboardFocusWithin is true, then select the item.
|
|
|
|
|
yes pass a event treeviewitem
|
|
|
|
|
Thank you that was enough to chase down the detail.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The trick was to add an ItemContainerStyle because I am using a HeirarchicalDataTemplate
<telerik:RadTreeView.ItemContainerStyle>
<Style TargetType="{x:Type telerik:RadTreeViewItem}">
<Style.Triggers>
<Trigger Property="IsKeyboardFocusWithin" Value="true">
<Setter Property="IsSelected" Value="true" />
</Trigger>
</Style.Triggers>
</Style>
</telerik:RadTreeView.ItemContainerStyle>
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi, I am looking for ideas. Have to create controls dynamically and store values of textbox, combobox in database. Suppose I will give number 5 in existing textbox then it should create 5 textboxes and 5 combobox dynamically, all values of controls also have to save. Please share yours ideas. Thanks
|
|
|
|
|
|
Good tutorial, but my thing is have to create controls and take input from dynamically created controls.
|
|
|
|
|
You really need to provide a lot more detail about what problems you are having in implementing this.
|
|
|
|
|
foreach (TabItem ti in MainWindow.mw.tcMain.Items)
{
if (Convert.ToInt16(ti.Tag) == r.id)
{
MainWindow.mw.tcMain.SelectedItem = ti;
return;
}
}
|
|
|
|