|
I have doubt with line:
public static readonly DependencyProperty coProperty = DependencyProperty.Register("CoType", typeof(int), typeof(UserControl1),
new UIPropertyMetadata(string.Empty, new PropertyChangedCallback(textChangedCallBack)));
As per my knowledge UIPropertyMetadata is mainly used for provide animation behavioure. I would suggest try with FrameworkPropertyMetaData for databinding purpose.
Just try on your side if still it is not working then I will look into that.
http://msdn.microsoft.com/en-us/library/ms751554.aspx[^]
Thanks for your patience!
Parwej Ahamad
ahamad.parwej@gmail.com
modified on Tuesday, March 30, 2010 9:53 AM
|
|
|
|
|
Dear friend
Thanks for your reply ,
i have changed those lines as
public static readonly DependencyProperty coProperty = DependencyProperty.Register("CoType", typeof(int), typeof(UserControl1),
new FrameworkPropertyMetadata(string.Empty, new PropertyChangedCallback(textChangedCallBack)));
but no use, if you have already done some samples on Custom Property ..please send it to i.joerozario@gmail.com other wise i will send my sample source.. if u correct that would be great help for me..
Thank you
|
|
|
|
|
Please send me your sample code on ahamad.parwej@gmail.com.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Hi Joe, I catch one more thing here you are not using Setter and Getter method:
public int CoType
{
get {return nType;}
set {
nType =value;
textBlock1.Text = value.ToString();
}
}
Should be like:
public int CoType
{
get { return (int)GetValue(coProperty ); }
set { SetValue(coProperty , value); }
}
Change your code and let me know.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Basic sample sent on your personal ID.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Dear Ahamad
Thanks for everything..
i found my mistake.
in the Usercontrol1.xaml i did not bind the text like
Text="{Binding RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type local:UserControl1}},
Path=CoType}"
Thank you
by
Joe
|
|
|
|
|
I don't know exactly why you got this error message, but your "dependency property" is NOT a properly declared and used dependency property!
use the "propdp" snippet in VS to declare one
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
I.
I'm building a Silverlight Interface and suddenly every time i try to save the project,a window is shown saying:
"C:\Users\Documents\Visual Studio 2008\projects\MyProject\MyProject\obj\debug\mainpage.g.cs.
This File was changed out of the source code text editor.
Do you wish Reload it?
|Yes| |Yes to all files| |No| |None|".
I would like to Know why this happened and how can i fix it.
Thanks very much.(Excuse my english but i'm trying the best to make my self clear )
Jonatan regards
|
|
|
|
|
Try doing a "clean solution" and save again.
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hello.
I had already tried to clean the solution and the problem subsisted. I fix it by deleting the obj folder where the mainpage.g.cs is stored.
Thanks any way for the tip.
regards jonatan.
|
|
|
|
|
jonatan_556 wrote: I fix it by deleting the obj folder where the mainpage.g.cs is stored.
Great .
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi, I want to create a MDI application in WPF which will contain some "x" tabs each having their own set of controls such as "Text boxes", "Combo boxes", "IP Address control" etc.
The no of tabs and the list of controls to be displayed in each tab are available in a XML file.
How to implement this?
Any help on this is highly appreciated.
|
|
|
|
|
In the mean time I am giving here steps. If you stuck anywhere then free to ask here. Thanks.
Step: 1- Arrange all data into XML properly. I am assuming each item having it's all required information.
Step: 2-
Crate a class contais that contains all required properties which can contain the XML item data.
Step: 3-
Load all XML tab item data using Linq in Generic list (Like: List<tabliteminfo>)
XDocument xmlDoc = XDocument.Load("TabItemsData.xml");
List<TabItemInfo> tabItemInfoList= (from tabItem in xmlDoc.Descendants("TabItems")
select new TabItemInfo
{
TabItemID =int.Parse(tabItem.Element("TabItemId").Value),
TabName = tabItem.Element("TabName").Value,
}).ToList<TabItemInfo>();
Step: 4-
On WPF window. Creat a Tabcontrol without any tabitem.
Note: No need to take Tabcontrol at design time. You can also take at runtime and add it into Grid or Stack Panel whatever panel are using.
Load all controls items as tab item.
foreach (TabItemInfo tabItemInfo in tabItemInfoList)
{
TabItem tabItem = new TabItem();
tabItem.Header = tabItemInfo.TabName;
moduleTabControls.Items.Add(tabItem);
}
Hope so it will help you.
Thanks for your patience
Parwej Ahamad
ahamad.parwej@gmail.com
modified on Tuesday, March 30, 2010 11:18 PM
|
|
|
|
|
Thanks Parwej. I will try this and let you know.
|
|
|
|
|
Dear friends
i have some clarification
i have Image in xaml ... i want to bind command for "double click" of the image ..
and i have the command in my view model.. how to do that?
can some one give me with example
thank you
|
|
|
|
|
Have a read of this thread[^]. You need an InputBinding, and this explains what you need to do.
"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
|
|
|
|
|
You can use a behavior or dependency property for double click instead of command.
|
|
|
|
|
Hi all,
I am new to the WPF arena and am trying to get started. I have created a simple winform containing a treeview and an elementhost containing my XAML. The XAML contains a textbox. When I select a node in the treeview I want to pass the node name to the textbox.
Everything is running fine but I do not know how to reference the controls within an XAML from the hosting winform. Any ideas, pointers, references I can look at?
|
|
|
|
|
Use this code:
Text="{Binding ElementName=treeViewControlID,
Path=SelectedNode.Text}"
I am not sure "SelectedNode.Text" is available but it may be kind of property. If it is not workable then post here.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
You can samply convert the child control to TextBox. Try this:
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
System.Windows.Controls.TextBox tb = (System.Windows.Controls.TextBox)(elementHost1.Child);
tb.Text = e.Node.Name;
}
modified 27-May-14 4:38am.
|
|
|
|
|
i want to animate the ListBoxItem while Scrolling. Any body have any Idea How i can do it Plz plz Give me some hints;
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
I got the Answere. Just Create a custom Panel and implement iScrollInfo interface.
Here is the Link
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
hi ..
I have added a user control to my aspx page & my aspx page take long time for a loading page.
any solution??
thnxx
|
|
|
|
|
Just adding a user control to a page should not slow down your application.
I can think of three things
1) There might be lot of stuff on your user control (converters etc) that could be slowing you down.
2) Your user control might be accessing a web service that might be slowing things down.
3) Once you deploy your application, the xap file is downloaded to your local machine. This could be taking some time. However, if you are running through your app through Visual Studio, it should not very slow.
|
|
|
|
|
yes m using web service to load my data from database & yes here is alot of staff that might be slowing down User Control.
Any solution??? how to prevent User Control slowing down???
|
|
|
|