locked
Opening my project makes Expression Blend 4 freeze. RRS feed

  • Question

  • Hello,

     

    For some reason, I became totally unable to open the project I am working on with Expression Blend. It was developped under Expression 4 and VS 2010, and I still can open it, build it and run it under VS2010. The WPF editor in VS is able to render it and everything. I only get a few warnings related to unreachable code and unused variables.

    When I try to open it with Expression Blend, first of all there is a message saying that opening this project could present a security risk. Then, when a I click yes to open it anyway, Expression Freezes. There is no message, no error or anything, it just freezes.

    I know you can't help me without my project, but is there a way I could see what is happening while the project is being loaded ?

     

    Thanks.

     

    Wednesday, July 27, 2011 2:57 PM

All replies

  • Is this new behavior? Was something new added recently? Does your project do anything interesting in the constructors or loaded events of your controls? Blend tries to build up more of your project to display on the design surface than VS does. This can sometimes cause problems if your controls do certain things that aren't allowed inside constructors (network access, using Application.Current, etc...).

     

    If you would like, feel free to send your project to me at first.last@microsoft.com (using my name) and I can try to replicate the problem.

    Wednesday, July 27, 2011 4:00 PM
    Moderator
  • Thanks. I finaly managed to open it by removing a user control from the main windows... guess it is what was causing the problem. I need that component anyway, here is its code. Please let me know if there is something wrong, I'll keep trying to make it work
    <br/><br/>using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using Microsoft.Research.Kinect.Nui;
    
    namespace ESRIprototype
    {
    	/// <summary>
    	/// Interaction logic for KinectMap.xaml
    	/// </summary>
    	public partial class KinectMap : UserControl
    	{
    
        // Interface avec la kinect.
        KinectWrapper kinect;
    
        // Différents modes de navigation sont possible, ils s'activent ici.
        enum PanStyle { Joystick, Drag };
        enum ZoomStyle { Simple, Multitouch };
        private const PanStyle panStyle = PanStyle.Drag;
        private const ZoomStyle zoomStyle = ZoomStyle.Multitouch;
    
        bool navigationOn;
        enum MapStates { Panning, Zoom, Rest};
        MapStates currentState=MapStates.Rest;
        ESRI.ArcGIS.Client.Automation.Peers.MapAutomationPeer peer;
    
        // Constantes.
        private const double PANFACTORX = 600;
        private const double PANFACTORY = 1000;
        private const double ZOOMPOWER = 3;
        private const double XPANTHRES = 0.5;
        private const double YPANTHRES = 0.5;
        //private const double GESTUREDELAY = 1200;
    
    		public KinectMap()
    		{
    			this.InitializeComponent();
    		}
    
        public void Setup(KinectWrapper kw)
        {
          this.kinect = kw; 
          kinect.recognizedGesture += new KinectWrapper.RecognizedGestureEventHandler(this.gestureUI);
          kinect.newDeltaCoords += new KinectWrapper.NewDeltaCoordsEventHandler(this.PanHandler);
          kinect.newZoom += new KinectWrapper.NewZoomEventHandler(this.ZoomHandler);
          peer = new ESRI.ArcGIS.Client.Automation.Peers.MapAutomationPeer(myMap);
    
        }
    
    
        private void gestureUI(object sender, RecognizedGestureEventArgs e)
        {
            if (e.gesture == "startPan" && currentState==MapStates.Rest)
            {
              kinect.startPan();
              currentState = MapStates.Panning;
              if(panStyle==PanStyle.Joystick)
                this.panM.Visibility=Visibility.Visible;
            }
            else if (e.gesture == "startZoom" && currentState != MapStates.Zoom)
            {
              kinect.startZoom();
              currentState = MapStates.Zoom;
            }
      
        }
    
    
        private void PanHandler(object sender, NewDeltaCoordsEventArgs a)
        {
          if (currentState == MapStates.Panning)
          {
            if (panStyle == PanStyle.Drag)
            {
              Dispatcher.Invoke(new Action(delegate()
              {
                /*peer.Navigate((Math.Abs(a.X) >= XPANTHRES ? -a.X/XPANTHRES * PANFACTOR : 0), (Math.Abs(a.Y) >= YPANTHRES ? -a.Y/YPANTHRES * PANFACTOR : 0));
                double tx = Math.Abs(a.X/XPANTHRES) > 1 ? 1*Math.Sign(a.X) : a.X/XPANTHRES ;
                double ty = Math.Abs(a.Y / YPANTHRES) > 1 ? 1 * Math.Sign(a.Y) : a.Y/YPANTHRES;
                this.panM.translate(tx,ty);*/
                peer.Navigate(a.X * PANFACTORX, a.Y * PANFACTORY);
                //myMap.Zoom(kinect.computeZoom());
    
              }));
            }
            else if (panStyle == PanStyle.Joystick)
            {
              peer.Navigate((Math.Abs(a.X) >= XPANTHRES ? -a.X / XPANTHRES * PANFACTORX : 0), (Math.Abs(a.Y) >= YPANTHRES ? -a.Y / YPANTHRES * PANFACTORY : 0));
              double tx = Math.Abs(a.X / XPANTHRES) > 1 ? 1 * Math.Sign(a.X) : a.X / XPANTHRES;
              double ty = Math.Abs(a.Y / YPANTHRES) > 1 ? 1 * Math.Sign(a.Y) : a.Y / YPANTHRES;
              this.panM.translate(tx, ty);
            }
    
          }
          if (!kinect.rightArmStrenched())
          {
            Dispatcher.Invoke(new Action(delegate()
            {
              if (currentState == MapStates.Panning)
              {
                this.panM.Visibility = Visibility.Hidden;
                currentState = MapStates.Rest;
              }
    
            }));
          }
        }
    
    
        private void ZoomHandler(object sender, NewZoomEventArgs a)
        {
          if (currentState == MapStates.Zoom)
          {
            Dispatcher.Invoke(new Action(delegate()
            {
              myMap.Zoom(Math.Pow(a.z, ZOOMPOWER));
            }));
            if (!kinect.rightArmStrenched() || !kinect.leftArmStrenched())
            {
              Dispatcher.Invoke(new Action(delegate()
              {
                if (currentState == MapStates.Zoom)
                {
                  currentState = MapStates.Rest;
                }
    
              }));
            }
          }
        }
    
    	}
    }
    

     

     

    <UserControl
    	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    	xmlns:esri="http://schemas.esri.com/arcgis/client/2009" xmlns:local="clr-namespace:ESRIprototype"
    	mc:Ignorable="d"
    	x:Class="ESRIprototype.KinectMap"
    	x:Name="KinectMapControl"
    	d:DesignWidth="994" d:DesignHeight="973">
    
    	<Grid x:Name="LayoutRoot">
    		<esri:Map x:Name="myMap" Background="White" WrapAround="True" PanDuration="00:00:00" ZoomDuration="00:00:00">
    			<esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
    		</esri:Map>
    		<local:PanMeter x:Name="panM" Margin="427,416.5,426,415.5" Opacity="0.3" Visibility="Hidden"/>
    	</Grid>
    </UserControl>
    

    I had some difficulties importing that KinectMap user control from Blend into VS... maybe I did something in the process.

     

    Thursday, July 28, 2011 7:36 AM
  • This problem occurs sometimes with my Blend. I have to delete the *.suo 

    file in the project directory.

     

     

     

    Try this and open it with Blend again. Then you can start an analysis why 

    this happend.

    Tuesday, August 2, 2011 5:36 AM