コード例 #1
0
 private void Recycle_Menu_detail_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     if (e.OriginalSource is Image)
     {
         page.Storyboard2.Begin();
         Image image = e.OriginalSource as Image;
         AcquirerModel acquirer = image.DataContext as AcquirerModel;
         if (image.Name == "btn_SeeInMap")
         {
             //AcquirerModel model = image.DataContext as AcquirerModel;
             //Image pin = new Image() { Source = new BitmapImage(new Uri("/Image_Recycle/bubble.png", UriKind.Relative)) };
             //pin.Width = 40;
             //pin.Height = 40;
             //pin.Tag = model.Id;
             //pin.DataContext = model;
             //page.layer.AddChild(pin, new GeoCoordinate(model.Latitude, model.Longitude));
             page.rb_Recycle.IsChecked = true;
            
             Recycle_Menu_1 menu = new Recycle_Menu_1();
             menu.tbl_BinName.Text = acquirer.BinName;
             menu.tbk_UserName.Text = acquirer.AcquirerName;
             menu.tbk_Phone.Text = acquirer.Phone;
             menu.tbk_Address.Text = acquirer.Address;
             menu.Tag = acquirer.Id;
             menu.Width = 300;
             menu.Height = 250;
             page.layer.AddChild(menu, new GeoCoordinate(acquirer.Latitude, acquirer.Longitude));
             page.map.SetView(new GeoCoordinate(acquirer.Latitude, acquirer.Longitude), 16);
             this.Visibility = Visibility.Collapsed;
         }
         else
         {
             Recycle_Menu_SendMessage control_SendMessage = new Recycle_Menu_SendMessage();
             control_SendMessage.Tag = acquirer.Id;
             control_SendMessage.tbk_Name.Text = acquirer.AcquirerName;
             control_SendMessage.Width = 350;
             control_SendMessage.Height = 330;
             control_SendMessage.Visibility = Visibility.Visible;
             page.LayoutRoot.Children.Add(control_SendMessage);
             this.Visibility = Visibility.Collapsed;
         }
     }
 }
コード例 #2
0
 void pin_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     Image pin = sender as Image;
     if (pin.DataContext is AcquirerModel)
     {
         AcquirerModel acquirer = pin.DataContext as AcquirerModel;
         Recycle_Menu_1 menu = new Recycle_Menu_1();
         menu.tbl_BinName.Text = acquirer.BinName;
         menu.tbk_UserName.Text = acquirer.AcquirerName;
         menu.tbk_Phone.Text = acquirer.Phone;
         menu.tbk_Address.Text = acquirer.Address;
         menu.Tag = acquirer.Id;
         menu.Width = 300;
         menu.Height = 250;
         layer.AddChild(menu, new GeoCoordinate(acquirer.Latitude, acquirer.Longitude));
     }
     else
     {
         RewardModel reward = pin.DataContext as RewardModel;
         Reward_Menu_1 menu = new Reward_Menu_1();
         menu.tbk_UserName.Text = reward.StoreName;
         menu.tbk_Phone.Text = reward.Phone;
         menu.tbk_Address.Text = reward.Address;
         menu.tbk_Describe.Text = reward.Describe;
         menu.image_Item.Source = new BitmapImage(new Uri(reward.AvatarUri, UriKind.Relative));
         menu.Width = 350;
         menu.Height = 250;
         layer.AddChild(menu, new GeoCoordinate(reward.Latitude, reward.Longitude));
     }
 }