using Container.Common; using Container.Model; using Container.Services; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace Container.ChildWindows { /// /// WindowAppChoose.xaml 的交互逻辑 /// public partial class WindowAppChoose : Window { //List AppList = new List(); private int columnCount = 18; private double widthSpace = 0;//横向间隔 private double heightSpace = 0;//纵向间隔 //private int rowCount = 0; private double cvsGoodsMinHeight = 0.00; App app = ((App)System.Windows.Application.Current); Class_Log log = new Class_Log(); public WindowAppChoose(double top, double left, double appwidth = 78) { InitializeComponent(); //Class_Config config = new Class_Config(); //config.ReadAppInfo(ref AppList); //if (left > SystemParameters.PrimaryScreenWidth / 2) //{ // AppButton.SetValue(LeftProperty, 0.00); // //Ggif.SetValue(LeftProperty, this.Width - 96); //} SetAppButton(); //this.Width = 90 + this.AppButton.Width; //Bborder.Width = this.Width; //if (left > SystemParameters.PrimaryScreenWidth / 2) //{ // //AppButton.SetValue(LeftProperty, 0); // Ggif.SetValue(LeftProperty, this.Width - 96); //} //this.Top = top;//SystemParameters.PrimaryScreenHeight - this.Height - 50; //if (left < 0) //{ // left = 0; //} //if (left - this.Width < 0) //{ // this.Left = 0; //} ////else if (left - this.Width > SystemParameters.PrimaryScreenWidth - this.Width) //// this.Left = SystemParameters.PrimaryScreenWidth - this.Width //else if (left <= SystemParameters.PrimaryScreenWidth / 2) //{ // this.Left = left - appwidth;// - this.Width //} //else //{ // this.Left = left - this.Width;// - this.Width //} //SystemParameters.PrimaryScreenWidth - this.Width; //this.Top = SystemParameters.PrimaryScreenHeight - this.Height - 50; //this.Left = SystemParameters.PrimaryScreenWidth - this.Width; } private void Win_Load(object sender, RoutedEventArgs e) { } public void SetAppButton() { //double goodWidth = 0; this.AppButton.Height = app.AppList.Count * 120; this.AppButton.Margin = new Thickness(0, 900 - this.AppButton.Height, 0, 0); try { for (int i = 0; i < app.AppList.Count; i++) { //int rowIndex = i / columnCount; //int columnIndex = i % columnCount; UCAppButton AppInfo = new UCAppButton(app.AppList[i]); //AppInfo.SetValue(Canvas.LeftProperty, 0); //AppInfo.SetValue(Canvas.TopProperty, 300); this.AppButton.Children.Add(AppInfo); //if (goodWidth == 0) // goodWidth = AppInfo.Width; } } catch (Exception e) { log.WriteLogFile("1111"+e.Message,"errrrrr"); } //this.AppButton.MinHeight = cvsGoodsMinHeight; //this.AppButton.Width = app.AppList.Count * (goodWidth + widthSpace) + widthSpace; } private void ButtonBack_Click(object sender, MouseButtonEventArgs e) { this.Close(); } private void mousedown(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { this.DragMove(); } } } }