I want to iterate all of controls of contentdialog if available.
because I want to get and set Tag Property of each controls in a contentdialog.
for example,
public ContentDialog MyDialog = new ContentDialog
{
Title = "My Title",
Content = "My Content",
PrimaryButtonText = "OK",
SecondaryButtonText = "Cancel",
};
for example pseudo code,
void DeepFirstSearch(ContentDialog IN_pMyDialog, DependencyObject IN_pControl)
{
foreach (pControl in IN_pMyDialog)
{
if ( pControl is TextBlock )
{
...
}
else if ( pControl is Button )
{
...
}
if (pControl.GetChildCount() > 0)
{
DeepFirstSearch(IN_pDialog, pControl)
}
}
}