<commit_before>using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using Q42.HueApi;
using Q42.HueApi.ColorConverters;
using Q42.HueApi.ColorConverters.HSB;
using Q42.HueApi.Interfaces;
using Q42.HueApi.Models.Bridge;
using Q42.HueApi.Models.Groups;
using Q42.WinRT.Portable.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Windows.UI.Xaml.Media;

namespace Q42.HueApi.UniversalWindows.Sample.ViewModel
{

  public class LightPositionVm : ViewModelBase
  {
    public string Id { get; set; }
    public LightLocation LightLocation { get; set; }

    int halfGridSize = 200;

    public LightPositionVm(KeyValuePair<string, LightLocation> original)
    {
      this.Id = original.Key;
      this.LightLocation = original.Value;
    }

    public double X
    {
      get { return (LightLocation.X * halfGridSize) + halfGridSize; }
      set
      {
        LightLocation.X = (value - halfGridSize) / halfGridSize;
        RaisePropertyChanged("X");
      }
    }

    public double Y
    {
      get { return (LightLocation.Y * -halfGridSize) + halfGridSize; }
      set
      {
        LightLocation.Y = (value - halfGridSize) / -halfGridSize;
        RaisePropertyChanged("Y");
      }
    }

  }

  /// <summary>
  /// This class contains properties that the main View can data bind to.
  /// <para>
  /// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
  /// </para>
  /// <para>
  /// You can also use Blend to data bind with the tool's support.
  /// </para>
  /// <para>
  /// See http://www.galasoft.ch/mvvm
  /// </para>
  /// </summary>
  public class MainViewModel : ViewModelBase
  {
    public DataLoader LocateBridgeDataLoader { get; set; }
    public RelayCommand LocateBridgeCommand { get; set; }

    public DataLoader SsdpLocateBridgeDataLoader { get; set; }
    public RelayCommand SsdpLocateBridgeCommand { get; set; }

    public DataLoader RegisterDataLoader { get; set; }


    public RelayCommand GetLightsCommand { get; set; }

    public RelayCommand TurnOnCommand { get; set; }
    public RelayCommand TurnOffCommand { get; set; }
    public RelayCommand GreenCommand { get; set; }
    public RelayCommand RedCommand { get; set; }
    public RelayCommand ColorloopCommand { get; set; }
    public RelayCommand FlashCommand { get; set; }


    private List<LightPositionVm> _groupForPositioning;

    public List<LightPositionVm> GroupForPositioning
    {
      get { return _groupForPositioning; }
      set
      {
        _groupForPositioning = value;
        RaisePropertyChanged("GroupForPositioning");
      }
    }


    IBridgeLocator httpLocator = new HttpBridgeLocator();

    internal void SendAlert(string id)
    {
      _hueClient.SendCommandAsync(new LightCommand() { Alert = Alert.Once }, new[] { id });
    }

    IBridgeLocator ssdpLocator = new HttpBridgeLocator();

    LocalHueClient _hueClient;


    private string _httpBridges;

    public string HttpBridges
    {
      get { return _httpBridges; }
      set
      {
        _httpBridges = value;
        RaisePropertyChanged("HttpBridges");
      }
    }
<commit_msg>Use SsdpBridgeLocator in sample<commit_after>using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using Q42.HueApi;
using Q42.HueApi.ColorConverters;
using Q42.HueApi.ColorConverters.HSB;
using Q42.HueApi.Interfaces;
using Q42.HueApi.Models.Bridge;
using Q42.HueApi.Models.Groups;
using Q42.WinRT.Portable.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Windows.UI.Xaml.Media;

namespace Q42.HueApi.UniversalWindows.Sample.ViewModel
{

  public class LightPositionVm : ViewModelBase
  {
    public string Id { get; set; }
    public LightLocation LightLocation { get; set; }

    int halfGridSize = 200;

    public LightPositionVm(KeyValuePair<string, LightLocation> original)
    {
      this.Id = original.Key;
      this.LightLocation = original.Value;
    }

    public double X
    {
      get { return (LightLocation.X * halfGridSize) + halfGridSize; }
      set
      {
        LightLocation.X = (value - halfGridSize) / halfGridSize;
        RaisePropertyChanged("X");
      }
    }

    public double Y
    {
      get { return (LightLocation.Y * -halfGridSize) + halfGridSize; }
      set
      {
        LightLocation.Y = (value - halfGridSize) / -halfGridSize;
        RaisePropertyChanged("Y");
      }
    }

  }

  /// <summary>
  /// This class contains properties that the main View can data bind to.
  /// <para>
  /// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
  /// </para>
  /// <para>
  /// You can also use Blend to data bind with the tool's support.
  /// </para>
  /// <para>
  /// See http://www.galasoft.ch/mvvm
  /// </para>
  /// </summary>
  public class MainViewModel : ViewModelBase
  {
    public DataLoader LocateBridgeDataLoader { get; set; }
    public RelayCommand LocateBridgeCommand { get; set; }

    public DataLoader SsdpLocateBridgeDataLoader { get; set; }
    public RelayCommand SsdpLocateBridgeCommand { get; set; }

    public DataLoader RegisterDataLoader { get; set; }


    public RelayCommand GetLightsCommand { get; set; }

    public RelayCommand TurnOnCommand { get; set; }
    public RelayCommand TurnOffCommand { get; set; }
    public RelayCommand GreenCommand { get; set; }
    public RelayCommand RedCommand { get; set; }
    public RelayCommand ColorloopCommand { get; set; }
    public RelayCommand FlashCommand { get; set; }


    private List<LightPositionVm> _groupForPositioning;

    public List<LightPositionVm> GroupForPositioning
    {
      get { return _groupForPositioning; }
      set
      {
        _groupForPositioning = value;
        RaisePropertyChanged("GroupForPositioning");
      }
    }


    IBridgeLocator httpLocator = new HttpBridgeLocator();

    internal void SendAlert(string id)
    {
      _hueClient.SendCommandAsync(new LightCommand() { Alert = Alert.Once }, new[] { id });
    }

    IBridgeLocator ssdpLocator = new SsdpBridgeLocator();

    LocalHueClient _hueClient;


    private string _httpBridges;

    public string HttpBridges
    {
      get { return _httpBridges; }
      set
      {
        _httpBridges = value;
        RaisePropertyChanged("HttpBridges");
      }
    }

{'fraction_non_alphanumeric': 0.09764521193092622, 'fraction_numerical': 0.005965463108320251, 'mean_word_length': 2.880024360535932, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3109196', 'n_tokens_mistral': 2058, 'n_tokens_neox': 1950, 'n_words': 479}