VisualStateManager.GetVisualStateGroups Method
Gets the value of the VisualStateManager.VisualStateGroups attached property.
Namespace: System.Windows
Assembly: System.Windows (in System.Windows.dll)
Parameters
- obj
- Type: System.Windows.FrameworkElement
The element from which to get the VisualStateManager.VisualStateGroups.
Return Value
Type: System.Collections.IListThe collection of VisualStateGroup objects that is associated with the specified object.
| Exception | Condition |
|---|---|
| ArgumentNullException |
obj is null. |
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Result of my connect Bug for empty collection always returned
"VisualStateGroups are usually set on the root of an element's visual tree, not on the element itself."$0
$0
- Jason R. Shaver
$0$0
$0
$0$0
$0
$0So even though the VisualStateManager.GoToState method applies to an object, reading back from that object is not necessarily going to yield the response you'd expect.$0
- 6/11/2011
- LukePuplett
May return empty.
I've registered a Connect bug report since I cannot get this work as expected. The following code, which I expect to be MANGLED by this awful comment editor, returns an empty collection.
$0
$0 private void Button_Click(object sender, RoutedEventArgs e)
{
// Testing bug in VSM:
//
var vsg = VisualStateManager.GetVisualStateGroups(sender as FrameworkElement);$0 $0
{
// Testing bug in VSM:
//
var vsg = VisualStateManager.GetVisualStateGroups(sender as FrameworkElement);$0 $0
- 2/18/2011
- LukePuplett