wpf - Access XAML object from code -


मैंने WPF में एक UserControl बनाया:

Xaml में:

  & Lt; UserControl x: क्लास = "OutlookPanel.MailRelation" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http://schemas.microsoft.com/winfx / 2006 / xaml "ऊँचाई =" 300 "चौड़ाई =" 300 "xmlns: ग्राफ =" clr-namespace: MyPanel "& gt; & LT; DockPanel & gt; & Lt; graph: ग्राफ़ नाम = "द ग्राफ" नोड्सबिंगपैथ = "चाइल्डनोड्स" नोडटैम्प्लेटसाइक्लियर = "{स्टेटिक रिसोर्स नोडटेमप्लेटसिलेक्टर}" & gt; .. & lt; / डॉकपैनेल & gt; & Lt; / UserControl & gt;  

मैं सीएस:

<पूर्व> ऑब्जेक्ट the टािंग = ई। पैरामीटर; ((मेल रिलेशन) प्रेषक)। TheGraph.CenterObject = theThing;

यह अंतिम वाक्य काम नहीं करता क्योंकि ग्राफ़ तक पहुंच योग्य नहीं है। कोई भी विचार क्यों मैं ग्राफ़ का उपयोग कर सकता हूं?

धन्यवाद

जॉन

नाम = "द ग्राफ"

होना चाहिए

x: name = "the graph"

से

x : नाम: ऑब्जेक्ट तत्व संसाधित किए जाने के बाद रन-टाइम कोड में मौजूद उदाहरण के लिए रन-टाइम ऑब्जेक्ट नाम निर्दिष्ट करता है। आप एक्स का उपयोग करते हैं: नामकरण तत्वों के मामलों के लिए नाम जहां समकक्ष WPF फ्रेमवर्क-स्तर का नाम गुण समर्थित नहीं है। यह कुछ एनिमेशन परिदृश्यों में होता है।


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -