Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Yeah I did it...

Yeah I did it...

Scheduled Pinned Locked Moved The Weird and The Wonderful
com
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VallarasuS
    wrote on last edited by
    #1

    Just a moment ago..

        private Visual GetChild(FrameworkElement source)
        {
            if (source == null) return null;
    
            var count = VisualTreeHelper.GetChildrenCount(source);
    
            for (int i = 0; count > 0; count--)
            {
                var child = VisualTreeHelper.GetChild(source, i);
    
                if (child is T)
                    return (Visual)child;
            }
    
            return null;
        }
    

    don't know what was in my mind!! ;P :facepalm:

    Regards Vallarasu S | FSharpMe.blogspot.com

    OriginalGriffO P 2 Replies Last reply
    0
    • V VallarasuS

      Just a moment ago..

          private Visual GetChild(FrameworkElement source)
          {
              if (source == null) return null;
      
              var count = VisualTreeHelper.GetChildrenCount(source);
      
              for (int i = 0; count > 0; count--)
              {
                  var child = VisualTreeHelper.GetChild(source, i);
      
                  if (child is T)
                      return (Visual)child;
              }
      
              return null;
          }
      

      don't know what was in my mind!! ;P :facepalm:

      Regards Vallarasu S | FSharpMe.blogspot.com

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Bit backwards today, are we? :laugh:

      Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      • V VallarasuS

        Just a moment ago..

            private Visual GetChild(FrameworkElement source)
            {
                if (source == null) return null;
        
                var count = VisualTreeHelper.GetChildrenCount(source);
        
                for (int i = 0; count > 0; count--)
                {
                    var child = VisualTreeHelper.GetChild(source, i);
        
                    if (child is T)
                        return (Visual)child;
                }
        
                return null;
            }
        

        don't know what was in my mind!! ;P :facepalm:

        Regards Vallarasu S | FSharpMe.blogspot.com

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        Ew, yuck, misuse of var, how could you? :-D

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups