Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

NT7 Conversion -- pop up window in WPF, how to?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    this code would be executed when there was some event, such as a button click, or another event triggered, like as a custom coded event, for exampe a market analyzer that scans a database of news events and when a news event is approaching, alarm with a pop up

    I can't give you specific examples because for me it is part of a complex framework and the context would not make sense (except to me)

    in general


    //----------------------------------------------------------------------------------------------------------------------


    to invoke it...

    using PopUpWindow;

    then to invoke the popup....

    Application.Current.Dispatcher.Invoke((Action)dele gate{PopUp();

    //----------------------------------------------------------------------------------------------------------------------


    and the PopUp is in the AddOnFolder, with these as the base

    //----------------------------------------------------------------------------------------------------------------------
    ​​
    namespace PopUpWindow
    {
    public class PopUpWindows_Class
    {
    public partial class PopUp : Window
    {​​

    public PopUp()
    {
    InitializeComponent();
    }


    //----------------------------------------------------------------------------------------------------------------------

    In InitializeComponent you construct the Window Layout with Code, like shown in the prior post

    as you are constructing the Windows you probably would like an ESC to close then window...then

    this.PreviewKeyDown += new KeyEventHandler(Form_KeyDown);

    private void Form_KeyDown(object sender, KeyEventArgs e)
    {
    if (e.Key == Key.Escape)
    Close();
    }​

    Comment


      #17
      this code would be executed when there was some event, such as a button click, or another event triggered, like as a custom coded event, for exampe a market analyzer that scans a database of news events and when a news event is approaching, alarm with a pop up

      I can't give you specific examples because for me it is part of a complex framework and the context would not make sense (except to me)

      in general


      //----------------------------------------------------------------------------------------------------------------------


      to invoke it...

      using PopUpWindow;

      then to invoke the popup....

      Application.Current.Dispatcher.Invoke((Action)dele gate{PopUp();

      //----------------------------------------------------------------------------------------------------------------------


      and the PopUp is in the AddOnFolder, with these as the base

      //----------------------------------------------------------------------------------------------------------------------
      ​​
      namespace PopUpWindow
      {
      public class PopUpWindows_Class
      {
      public partial class PopUp : Window
      {​​

      public PopUp()
      {
      InitializeComponent();
      }


      //----------------------------------------------------------------------------------------------------------------------

      In InitializeComponent you construct the Window Layout with Code, like shown in the prior post

      as you are constructing the Windows you probably would like an ESC to close then window...then

      this.PreviewKeyDown += new KeyEventHandler(Form_KeyDown);

      private void Form_KeyDown(object sender, KeyEventArgs e)
      {
      if (e.Key == Key.Escape)
      Close();
      }​

      Comment


        #18
        Originally posted by llanqui View Post
        this code would be executed when there was some event, such as a button click, or another event triggered, like as a custom coded event, for exampe a market analyzer that scans a database of news events and when a news event is approaching, alarm with a pop up

        I can't give you specific examples because for me it is part of a complex framework and the context would not make sense (except to me)

        in general


        //----------------------------------------------------------------------------------------------------------------------


        to invoke it...

        using PopUpWindow;

        then to invoke the popup....

        Application.Current.Dispatcher.Invoke((Action)dele gate{PopUp();

        //----------------------------------------------------------------------------------------------------------------------


        This is my understanding ---> So, the invokation above will be in an Indicator (for example and in my case)

        And the codes below shall be in the AddOn Folder as you indicated above.

        I want to implement this in an Indicator. I'll let you know how I'm progressing.​


        and the PopUp is in the AddOnFolder, with these as the base

        //----------------------------------------------------------------------------------------------------------------------
        ​​
        namespace PopUpWindow
        {
        public class PopUpWindows_Class
        {
        public partial class PopUp : Window
        {​​

        public PopUp()
        {
        InitializeComponent();
        }


        //----------------------------------------------------------------------------------------------------------------------

        In InitializeComponent you construct the Window Layout with Code, like shown in the prior post

        as you are constructing the Windows you probably would like an ESC to close then window...then

        this.PreviewKeyDown += new KeyEventHandler(Form_KeyDown);

        private void Form_KeyDown(object sender, KeyEventArgs e)
        {
        if (e.Key == Key.Escape)
        Close();
        }​
        Thanks once again.

        omololu
        Last edited by omololu; 12-15-2022, 11:05 AM.

        Comment


          #19
          well, the pop up itself is not an indicator...it is a WPF Window that is in the AddOn folder....

          the invocation is in the indicator

          Comment


            #20
            Originally posted by llanqui View Post
            well, the pop up itself is not an indicator...it is a WPF Window that is in the AddOn folder....

            the invocation is in the indicator
            Yes, I understand.

            omololu

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by WHICKED, Today, 12:45 PM
            2 responses
            16 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Started by GussJ, 03-04-2020, 03:11 PM
            15 responses
            3,272 views
            0 likes
            Last Post xiinteractive  
            Started by Tim-c, Today, 02:10 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Taddypole, Today, 02:47 PM
            0 responses
            2 views
            0 likes
            Last Post Taddypole  
            Started by chbruno, 04-24-2024, 04:10 PM
            4 responses
            51 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Working...
            X