Main Site Documentation

N18 display WPF window


#1

Hello
I want to handle my display views using wpf. but after this line of code executed :


I get this error :
[quote]ERROR: You can only use WPF on one display (and if an LCD is present, only on the LCD)[/quote]
I've connect my n18 display to raptor mainboard on socket 11...
what is the problem?!

#2

The message says thet the LCD Controller is enabled and I guess WPF is bound to it by Default.
What Kind of Project do you have Gadgeteer or plain NETMF?
Check if a Display is configured for your raptor with FEZ Config.
Please post all your initialization code up to the line that Fails.


#3

@ Reinhard Ostermeier -
no WPF is not bounded…
My project is Gadgeteer . and this is startup code :


   public partial class Program : Gadgeteer.Program {
        
         private Gadgeteer.Modules.GHIElectronics.UsbClientDP usbClientDP;
        
            private Gadgeteer.Modules.GHIElectronics.Display_N18 display_N18;
        
        private Gadgeteer.Modules.GHIElectronics.Button button;
        
         private Gadgeteer.Modules.GHIElectronics.Button button2;
        
      
        protected new static GHIElectronics.Gadgeteer.FEZRaptor Mainboard {
            get {
                return ((GHIElectronics.Gadgeteer.FEZRaptor)(Gadgeteer.Program.Mainboard));
            }
            set {
                Gadgeteer.Program.Mainboard = value;
            }
        }
        
    
        public static void Main() {
             Program.Mainboard = new GHIElectronics.Gadgeteer.FEZRaptor();
            Program p = new Program();
            p.InitializeModules();
            p.ProgramStarted();
            p.Run();
        }
        
        private void InitializeModules() {
            this.usbClientDP = new GTM.GHIElectronics.UsbClientDP(8);
            this.display_N18 = new GTM.GHIElectronics.Display_N18(11);
            this.button = new GTM.GHIElectronics.Button(18);
            this.button2 = new GTM.GHIElectronics.Button(17);
        }
    }


  public partial class Program
    {

       
        Font fnt = Resources.GetFont(Resources.FontResources.Tahoma16);

         Image imgCapacity;
        int imgCapacityX = 200;
        int imgCapacityY = 5;

    Window window;
        Canvas canvas;

        private CellularRadioManager _radioManager;
        private readonly string _crlf = "" + (char)13 + (char)10;


        void ProgramStarted()
        {
            SetUpWindow();
         
        }
        private void SetUpWindow()
        {
            window = display_N18.WPFWindow;
            canvas = new Canvas();
            window.Child = canvas;

            imgCapacity = new Image(new Bitmap(Resources.GetBytes(Resources.BinaryResources.imgCapacity), Bitmap.BitmapImageType.Bmp));
          

            canvas.Children.Add(imgCapacity);
            Canvas.SetLeft(imgCapacity, imgCapacityX);
            Canvas.SetTop(imgCapacity, imgCapacityY);

            canvas.UpdateLayout();
            window.UpdateLayout();
            
        }
    
    }




#4

Hard to tell where this Comes from, but since Gadgeteer is open source you could look into the sources where and when this error is displayed.


#5

Do you have, or have you had, a LCD display, like the TE35, attached to your mainboard? If so, reload the firmware. This will disassociate the LCD display from the board.