Interaction logic for Properties.xaml
Inheritance: System.Windows.Window
 private static void LoadWindow(WrapperFileSystemInfo path, Properties p, object caller, Point? pos)
 {
     p.WindowStartupLocation = WindowStartupLocation.Manual;
     p.Opacity = 1;
     if (pos != null)
     {
         p.Left = pos.Value.X;
         p.Top = pos.Value.Y;
     }
     if (path != null)
     {
         p.CurrentPath = path.Info.Path;
         if (!path.Type.File)
             CairoExplorerWindow.AsyncGetSizeOfDirectory(path.Info.Path, path, delegate(WrapperFileSystemInfo file, double size, object param)
             {
                 Application.Current.Dispatcher.Invoke(new Action(delegate()
                 {
                     file.ByteSize = size;
                     if(p.CurrentPath == file.Info.Path)
                         p.InitWithFile(file, caller);
                 }));
             });
          else
             p.InitWithFile(path, caller);
     }
 }
        public void Preview(object path, object caller, System.Windows.Point? pos)
        {
            Application.Current.Dispatcher.Invoke(new Action(delegate()
            {
                Properties p = null;
                foreach (var w in Application.Current.Windows)
                    if (w is Properties)
                        p = (Properties)w;

                if (p != null)
                    LoadWindow(path as WrapperFileSystemInfo, p, caller, pos);
                else
                {
                    p = new Properties();
                    p.Loaded += delegate(object sender, RoutedEventArgs e)
                    {
                        LoadWindow(path as WrapperFileSystemInfo, p, caller, pos);
                    };
                    p.Show();
                }
            }));
        }