Beispiel #1
0
 public void Initialize(List <ChatPage> _openedConnection, int nr, int _mynumber)
 {
     istnieje = false;
     idx      = 0;
     myNumber = _mynumber;
     //nr_z_sel_item = Int32.Parse(selected);
     openedConnections = _openedConnection;
     //openedConnections.Add(new ChatPage(idx, nr));
     foreach (ChatPage chatPage in openedConnections)
     {
         if (chatPage.nr == nr)
         {
             istnieje = true;
         }
     }
     if (istnieje == true)
     {
         foreach (ChatPage chatPage in openedConnections)
         {
             if (chatPage.nr == nr_z_sel_item)
             {
                 idx = openedConnections.IndexOf(chatPage);
             }
         }
         _mainFrame.Navigate(openedConnections[idx]);
     }
     else
     {
         ChatPage strona = new ChatPage(nr, myNumber);
         openedConnections.Add(strona);
         idx = openedConnections.IndexOf(strona);
         Console.WriteLine("Index w elsie" + idx);
         _mainFrame.Navigate(openedConnections[idx]); //Bug wyswietlil idx 1
     }
 }
Beispiel #2
0
 public ScreenViewer(ChatPage screen)
 {
     InitializeComponent();
     activePage = screen;
 }