|
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;
}
}
|
|
|
|
|
That code selects the TabItem whose Tag is an int16 value that matches r.id.
The Tag property is present in many controls and is a custom user value not used by Wpf. You can use it to store an object of your choice and perform your custom logic based on it, for example save the original id such as in this code
|
|
|
|
|
|
Hi!
I have read along with this article [^]regarding WPF applications with Markup extensions.
In the end of the article there is the section called Custom Markup Extension example which I have tried and got working. The XAML code for the example confuse me.
In the articles C# code there is the ReflectionExtension class
public class ReflectionExtension : MarkupExtension
{
...
}
But in the XAML code there is no reference to ReflectionExtension instead there is a refence to Reflection.
<ListBox ItemsSource="{local:Reflection {x:Type Grid},
IncludeMethods=true, IncludeFields=true, IncludeEvents=true}"
MaxHeight="200" Grid.Row="3" Grid.ColumnSpan="2" />
I cannot find any reference what so ever in the article for Reflection, but somehow the example manage to reference to ReflectionExtension, compile and run.
If I rename the ReflectionExtension to MagicClass I must re-build the entire solution and change the XAML to:
<ListBox ItemsSource="{local:MagicClass{x:Type Grid},
IncludeMethods=true, IncludeFields=true, IncludeEvents=true}"
MaxHeight="200" Grid.Row="3" Grid.ColumnSpan="2" />
...or else the solution will not compile.
Is there a simple explanation for this?
I also have a further question regarding Markup Extensions.
In my company we have a language project which have classes deriving the MarkupExtension class. This gives the possibility in design time of XAML to
show different language text for buttons, labels and whatever other UIElement control that can display a text. The interesting is that I can switch language while in design-time and the XAML automatically display the selected language's text.
Unfortunately I cannot give away a example of this source code and might give me an explain how this works, but the XAML code I use is this:
<Button Content="{l:Lang Key=20}" \>
The "l" is the namespace reference xmlns:l="clr-namespace:namespace;assembly=assembly".
The "lang" must be a reference to a class deriving the MarkupExtension class. But I have search in the entire project for "lang" and cannot find ANY reference to it what so ever.
The "Key=20" is a reference to a the current language file with indices. In the my example there must be an index with value 20 which contain some text for whatever language is selected.
Without having the source code, can someone explain this?
Best regards,
/Steffe
|
|
|
|
|
Steffe - MarkupExtensions apply a little bit of magic here. If you add Extension to the end of your MarkupExtension class, you can leave this out of your XAML and the compiler will pick up which one you're trying to use.
As to your other question, is there a class called LangExtension in there by any chance?
|
|
|
|
|
Thanks for the reply Pete!
I will check that tomorrow if some class is named "LangExtension". I know there are two classes deriving the MarkupExtension class, so one of the must it be.
Another question: Is the MarkupExtension class meant to execute XAML code in design-time as well as runtime? The example I give with language project, in my original post, gives me a HUGE advantage when creating GUIs.
I have tried to understand the documentation of Markup extension on MSDN[^] but it is to big to scope, to generalized explaination and no obvious super easy example
Any suggestion of source which I can study?
/Steffe
|
|
|
|