Browse Source

Fixed according to TODO.

pull/39/head
Steven Kirk 11 years ago
parent
commit
574c7a9113
  1. 4
      Perspex.Controls/ControlExtensions.cs

4
Perspex.Controls/ControlExtensions.cs

@ -10,15 +10,15 @@ namespace Perspex.Controls
using System.Collections.Generic;
using System.Linq;
using Perspex.Controls;
using Perspex.LogicalTree;
using Perspex.Styling;
using Perspex.VisualTree;
public static class ControlExtensions
{
// TODO: This needs to traverse the logical tree, not the visual.
public static T FindControl<T>(this Control control, string id) where T : Control
{
return control.GetVisualDescendents()
return control.GetLogicalDescendents()
.OfType<T>()
.FirstOrDefault(x => x.Id == id);
}

Loading…
Cancel
Save