title: Convert object to Dictionary and get values in WPF
body: <p>I have a <code>ListView</code> assigned with <code>Dictionary&lt;string,Type&gt;</code> values. While dropping the values the following event will raise. Here i need to get the values of the selected item.</p>
  
  <p><code>if (data.GetDataPresent(typeof(Dictionary&lt;string, Type&gt;)))</code> validation passed. 
  But <code>var info = data.GetData(typeof(Dictionary&lt;string, Type&gt;)) as Dictionary&lt;string, Type&gt;;</code> returns null.</p>
  
  <pre><code>private void Canvas_PreviewDrop(object sender, DragEventArgs e)
      {
          var data = e.Data;
          Point p = e.GetPosition(UIRootCanvas);
          //    MainWindow parentWindow = Window.GetWindow(this) as MainWindow;
  
          if (data.GetDataPresent(typeof(Dictionary&lt;string, Type&gt;)))
          {
              var info = data.GetData(typeof(Dictionary&lt;string, Type&gt;)) as Dictionary&lt;string, Type&gt;;
              string qq = info.GetType().GetProperties()
                    .ToDictionary(x =&gt; x.Name, x =&gt; x.GetValue(info)?.ToString() ?? "").Values.ElementAt(0);
              if (qq == "checkbox")
  
              {
                  CheckBox ss = new CheckBox();
                  ss.Width = 20;
                  UIRootCanvas.Children.Add(ss);
                  Canvas.SetLeft(ss, p.X);
                  Canvas.SetTop(ss, p.Y);
              }
          }
      }
  </code></pre>