12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004 |
- using PDF_Office.EventAggregators;
- using PDF_Office.Helper;
- using PDF_Office.Model.PageEdit;
- using PDF_Office.ViewModels.PageEdit;
- using Prism.Events;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Controls.Primitives;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using System.Windows.Threading;
- using WpfToolkit.Controls;
- namespace PDF_Office.Views.PageEdit
- {
-
-
-
- public partial class PageEditContent : UserControl
- {
-
-
-
-
- private IEventAggregator eventor;
-
-
-
- private string unicode;
-
-
-
- private bool isFirstScrollChange = true;
-
-
-
- private DispatcherTimer timer = new DispatcherTimer();
-
-
-
- private bool startChoose = false;
-
-
-
- private Point starPosition = new Point();
-
-
-
- private ScrollEventType scrolltype = ScrollEventType.EndScroll;
-
- private double item_x;
- private double item_y;
-
- private int InsertIndex = -1;
-
- private PageEditItem tempItem;
-
-
-
- private bool isFrontHalf = false;
-
-
-
- private bool isDraging = false;
-
- private bool isDragingEnter = false;
-
-
-
- private bool needScroll = false;
-
- private int speed = 0;
- private PageEditContentViewModel viewModel;
- public PageEditContent()
- {
- InitializeComponent();
- }
- public PageEditContent(IEventAggregator eventAggregator) :this()
- {
- eventor = eventAggregator;
- unicode = App.mainWindowViewModel.SelectedItem.Unicode;
- timer.Interval = TimeSpan.FromSeconds(0.3);
- timer.Tick += Timer_Tick;
- viewModel = this.DataContext as PageEditContentViewModel;
-
- eventor.GetEvent<PageEditNotifyEvent>().Subscribe(OneNotifyEvent, e => e.Unicode == unicode);
- }
- private void Timer_Tick(object sender, EventArgs e)
- {
- PulishEvent();
- timer.Stop();
- }
- private void OneNotifyEvent(PageEditNotifyEventArgs e)
- {
- if (e.Type == NotifyType.RefreshPage)
- {
- PulishEvent();
- }
- else
- {
- if (e.Type == NotifyType.SelectItems)
- {
- if (e.PageRange.Count == 1)
- {
- ListPageEdit.SelectedIndex = e.PageRange[0] - 1;
- ListPageEdit.ScrollIntoView(ListPageEdit.SelectedItem);
- }
- else
- {
- ListPageEdit.SelectedItems.Clear();
- for (int i = 0; i < e.PageRange.Count; i++)
- {
- ListPageEdit.SelectedItems.Add(ListPageEdit.Items[e.PageRange[i] - 1]);
- }
- }
- }
- }
- }
- #region UI事件
-
-
-
-
-
- private void PageEdit_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
- {
- if((bool)e.NewValue)
- {
-
- PulishEvent();
-
- isFirstScrollChange = true;
- }
- }
-
-
-
-
-
- private void ListPageEdit_ScrollChanged(object sender, ScrollChangedEventArgs e)
- {
- if (isFirstScrollChange)
- {
- PulishEvent();
- isFirstScrollChange = false;
- return;
- }
- else
- {
- if (e.VerticalChange != 0)
- timer.Start();
- }
- }
-
-
-
-
-
- private void ListPageEdit_Scroll(object sender, System.Windows.Controls.Primitives.ScrollEventArgs e)
- {
- scrolltype = e.ScrollEventType;
- if (scrolltype != System.Windows.Controls.Primitives.ScrollEventType.EndScroll)
- {
- timer.Stop();
- return;
- }
- PulishEvent();
- }
- #endregion
- #region 方法
-
-
-
- private void PulishEvent()
- {
- var itemSize = (ListPageEdit.Items[0] as PageEditItem).ItemSize;
- var range = GetRoughFromView(ListPageEdit, itemSize, new Thickness(5, 10, 5, 10));
- eventor.GetEvent<PageEditRefreshEvent>().Publish(new PageEditRefreshEventArgs() { Unicode = unicode, PageRange = range });
- }
-
-
-
-
-
-
-
-
- private Tuple<int, int, int> GetRoughFromView(ListBox view, Size itemSize, Thickness itemMargin)
- {
-
- var scrollViewer = CommonHelper.FindVisualChild<ScrollViewer>(view);
- if (scrollViewer == null || scrollViewer.ActualHeight == 0 || scrollViewer.ActualWidth == 0)
- return new Tuple<int, int, int>(0, 0, 0);
- try
- {
- var currentHeight = scrollViewer.ActualHeight - view.Padding.Top;
- var currentWidth = scrollViewer.ActualWidth;
-
- var columnCount = (int)(currentWidth / (itemSize.Width + itemMargin.Left));
- var rowCount = (int)Math.Ceiling(currentHeight / (itemSize.Height + itemMargin.Bottom));
- var preItemCount = (int)((scrollViewer.VerticalOffset / scrollViewer.ExtentHeight) * ((view.Items.Count + columnCount - 1) / columnCount));
- preItemCount = preItemCount * columnCount;
- var preEnd = (int)(((scrollViewer.VerticalOffset + scrollViewer.ActualHeight) / scrollViewer.ExtentHeight) * ((view.Items.Count + columnCount - 1) / columnCount));
- preEnd = preEnd * columnCount + columnCount - 1;
- var middle = (int)Math.Ceiling(preItemCount + preEnd / 2d);
- return new Tuple<int, int, int>(
- Math.Max(preItemCount, 0),
- Math.Min(view.Items.Count, preEnd),
- middle);
- }
- catch { }
- return new Tuple<int, int, int>(0, 0, 0);
- }
-
-
-
-
-
-
- private ScrollViewer GetScrollHost(ListBox listBox)
- {
- if (VisualTreeHelper.GetChildrenCount(listBox) > 0)
- {
- int s = VisualTreeHelper.GetChildrenCount(listBox);
- Border border = VisualTreeHelper.GetChild(listBox, 0) as Border;
- if (border != null)
- {
- return VisualTreeHelper.GetChild(border, 0) as ScrollViewer;
- }
- }
- return null;
- }
- #endregion
-
-
-
-
-
- private void TextBox_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
- {
- if((bool)e.NewValue)
- {
- (sender as Control).Focus();
- }
- }
- private void ListPageEdit_PreviewMouseMove(object sender, MouseEventArgs e)
- {
- try
- {
- if (e.LeftButton == MouseButtonState.Pressed)
- {
-
- if (startChoose)
- {
- var position = e.GetPosition(ListPageEdit);
- if (position.X < 5 || position.X > ListPageEdit.ActualWidth - 5 || position.Y < 5 || position.Y > ListPageEdit.ActualHeight - 5)
- {
- startChoose = false;
- RectChoose.Visibility = Visibility.Collapsed;
-
- Mouse.Capture(null);
- return;
- }
-
- DoSelectItems();
- return;
- }
-
- var pos = e.GetPosition(ListPageEdit);
- if (pos.Y < 0 || pos.Y > ListPageEdit.ActualHeight)
- {
- LineInset.Visibility = Visibility.Collapsed;
- return;
- }
- HitTestResult result = VisualTreeHelper.HitTest(ListPageEdit, pos);
- if (result == null)
- {
- return;
- }
- var listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
- if (listBoxItem == null)
- {
- return;
- }
- isDragingEnter = false;
- tempItem = listBoxItem.DataContext as PageEditItem;
- var item_pos = e.GetPosition(listBoxItem);
- if (item_pos != null)
- {
- item_x = item_pos.X;
- item_y = item_pos.Y;
- }
- var scroll = GetScrollHost(ListPageEdit);
- string tempPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "Temp.pdf");
- System.IO.File.Create(tempPath);
- string[] files = new string[1];
- files[0] = tempPath;
- DataObject dataObj = new DataObject(DataFormats.FileDrop, files);
- DragDrop.DoDragDrop(ListPageEdit, dataObj, DragDropEffects.Copy);
- Mouse.Capture(ListPageEdit);
- return;
- }
- RectChoose.Visibility = Visibility.Collapsed;
- startChoose = false;
- Mouse.Capture(null);
- }
- catch
- {
- LineInset.Visibility = Visibility.Collapsed;
- }
- }
-
-
-
-
-
- private void ListPageEdit_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- var pos = e.GetPosition(ListPageEdit);
- HitTestResult result = VisualTreeHelper.HitTest(ListPageEdit, pos);
- if (result == null)
- {
- return;
- }
-
- var listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
- var scroller = CommonHelper.FindVisualParent<ScrollBar>(result.VisualHit);
- if (listBoxItem == null)
- {
- if (scroller != null)
- {
- startChoose = false;
- return;
- }
-
- startChoose = true;
- if (ListPageEdit.SelectedItems.Count > 0)
- {
- ListPageEdit.SelectedItems.Clear();
- }
- starPosition = e.GetPosition(ListPageEdit);
- starPosition = new Point(starPosition.X, starPosition.Y + GetWrapPanel(ListPageEdit).VerticalOffset);
- Mouse.Capture(ListPageEdit);
- return;
- }
-
- startChoose = false;
- }
- private void ListPageEdit_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
- {
- startChoose = false;
- Mouse.Capture(null);
- RectChoose.Visibility = Visibility.Collapsed;
- }
-
-
-
-
-
- public VirtualizingWrapPanel GetWrapPanel(ListBox listBox)
- {
- Border border = VisualTreeHelper.GetChild(listBox, 0) as Border;
- var panel = CommonHelper.FindVisualChild<VirtualizingWrapPanel>(border);
- return panel;
- }
-
-
-
- private void DoSelectItems()
- {
- var s = GetScrollHost(ListPageEdit);
- Point start = new Point();
-
- start = new Point(starPosition.X, starPosition.Y - s.VerticalOffset);
- var rec = new Rect(start, Mouse.GetPosition(ListPageEdit));
- RectChoose.Margin = new Thickness(rec.Left, rec.Top, 0, 0);
- RectChoose.Width = rec.Width;
- RectChoose.Height = rec.Height;
- RectChoose.Visibility = Visibility.Visible;
-
- for (int i = 0; i < ListPageEdit.Items.Count; i++)
- {
- var _item = ListPageEdit.ItemContainerGenerator.ContainerFromIndex(i) as ListBoxItem;
-
- var parent = CommonHelper.FindVisualParent<VirtualizingWrapPanel>(_item);
- if (parent == null)
- continue;
- var v = VisualTreeHelper.GetOffset(_item);
- if (rec.IntersectsWith(new Rect(v.X, v.Y, _item.ActualWidth, _item.ActualHeight)))
- {
- ListPageEdit.SelectedItems.Add(ListPageEdit.Items[i]);
- }
- else
- {
- ListPageEdit.SelectedItems.Remove(ListPageEdit.Items[i]);
- }
- }
- return;
- }
-
-
-
-
-
- private void ListPageEdit_DragOver(object sender, DragEventArgs e)
- {
- try
- {
-
- if (e.KeyStates == (DragDropKeyStates.ControlKey | DragDropKeyStates.LeftMouseButton) || e.KeyStates == (DragDropKeyStates.ShiftKey | DragDropKeyStates.LeftMouseButton | DragDropKeyStates.ControlKey))
- return;
-
-
- var pos = e.GetPosition(ListPageEdit);
- var result = VisualTreeHelper.HitTest(ListPageEdit, pos);
- if (result == null)
- {
-
-
- }
-
- var listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
- if (listBoxItem == null)
- {
-
-
- }
- #region 计算虚影位置
-
- double xPos = 0;
- double yPos = 0;
-
- if (!isDragingEnter)
- {
-
- ImgPicture.Width = tempItem.ItemSize.Width;
- ImgPicture.Height = tempItem.ItemSize.Height;
- ImgPicture.Source = tempItem.Image;
- xPos = e.GetPosition(ListPageEdit).X - item_x;
- yPos = e.GetPosition(ListPageEdit).Y - item_y;
- }
-
-
-
-
-
-
-
-
-
-
- ImgPicture.Margin = new Thickness(xPos, yPos, 0, 0);
- #endregion
- #region 计算插入标记位置
- var scroll = GetScrollHost(ListPageEdit);
- if (listBoxItem != null)
- {
-
- var p = VisualTreeHelper.GetOffset(listBoxItem);
- LineInset.Visibility = Visibility.Visible;
- var panel = GetWrapPanel(ListPageEdit);
- var item = (ListPageEdit.ItemContainerGenerator.ContainerFromIndex(0) as ListBoxItem).DesiredSize.Width;
- int count = (int)(panel.ViewportWidth / item);
- var gap = (panel.ViewportWidth - count * item) / (count + 1) * 1.0;
- LineInset.X2 = LineInset.X1 = p.X + gap / 2 + listBoxItem.DesiredSize.Width;
- if (pos.X < p.X + gap / 2 + listBoxItem.ActualWidth / 2)
- {
- isFrontHalf = true;
- LineInset.X2 = LineInset.X1 = p.X - gap / 2;
- InsertIndex = ListPageEdit.Items.IndexOf(listBoxItem);
- }
- else
- {
- isFrontHalf = false;
- InsertIndex = ListPageEdit.Items.IndexOf(listBoxItem) + 1;
- }
-
- LineInset.Y1 = p.Y;
- if (LineInset.Y1 < 0)
- {
- LineInset.Y1 = 0;
- }
-
- LineInset.Y2 = p.Y + listBoxItem.ActualHeight;
- if (LineInset.Y2 < 0)
- {
- LineInset.Y2 = 0;
- }
- }
- #endregion
-
- if (pos.Y <= 30 || pos.Y >= ListPageEdit.ActualHeight - 10)
- {
- LineInset.Visibility = Visibility.Collapsed;
- needScroll = false;
- }
- if (pos.X <= 40 || pos.X >= scroll.ViewportWidth - 50)
- {
- LineInset.Visibility = Visibility.Collapsed;
- needScroll = false;
- }
- #region 靠近上下边界时,自动滚动,离边界越近,滚动速度越快
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #endregion
- }
- catch (Exception ex)
- {
- }
- }
-
-
-
- private void ExitDraging()
- {
- LineInset.Visibility = Visibility.Collapsed;
- isDraging = false;
- }
-
-
-
-
-
- private void ListPageEdit_Drop(object sender, DragEventArgs e)
- {
- needScroll = false;
- if (!isDraging)
- {
-
- LineInset.Visibility = Visibility.Collapsed;
- return;
- }
- #region 功能付费锁
-
-
-
-
-
-
-
- #endregion
- #region 从外部拖拽插入文件
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #endregion
- var pos = e.GetPosition(ListPageEdit);
- var result = VisualTreeHelper.HitTest(ListPageEdit, pos);
- if (result == null)
- {
-
- ExitDraging();
- return;
- }
-
- var sourcePerson = e.Data.GetData(typeof(StackPanel)) as StackPanel;
- if (sourcePerson == null)
- {
- ExitDraging();
- return;
- }
-
- int targetindex = 0;
- if (InsertIndex != -1)
- {
-
- targetindex = InsertIndex;
- }
- else
- {
- var listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
- if (listBoxItem == null)
- {
-
- ExitDraging();
- return;
- }
- var targetPerson = listBoxItem;
- targetPerson.Opacity = 1;
- sourcePerson.Opacity = 1;
- if (ReferenceEquals(targetPerson, sourcePerson))
- {
- ExitDraging();
- return;
- }
- targetindex = ListPageEdit.Items.IndexOf(targetPerson);
- }
- List<ListBoxItem> list = new List<ListBoxItem>();
- List<int> sourceindex = new List<int>();
-
- List<int> pages = new List<int>();
-
- for (int i = 0; i < ListPageEdit.SelectedItems.Count; i++)
- {
- var pageindex = ListPageEdit.Items.IndexOf(ListPageEdit.SelectedItems[i] as ListBoxItem);
- pages.Add(pageindex);
- }
- pages.Sort();
- if (pages.Count <= 0)
- {
- ExitDraging();
- return;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- isDraging = false;
- }
- private void MidLane_Drop(object sender, DragEventArgs e)
- {
- ListPageEdit_Drop(sender, e);
- }
- private void ImgPicture_Drop(object sender, DragEventArgs e)
- {
- ListPageEdit_Drop(sender, e);
- }
-
-
-
-
-
- private void Grid_DragOver(object sender, DragEventArgs e)
- {
- try
- {
-
- if (e.KeyStates == (DragDropKeyStates.ControlKey | DragDropKeyStates.LeftMouseButton) || e.KeyStates == (DragDropKeyStates.ShiftKey | DragDropKeyStates.LeftMouseButton | DragDropKeyStates.ControlKey))
- return;
-
-
- var pos = e.GetPosition(ListPageEdit);
- var result = VisualTreeHelper.HitTest(ListPageEdit, pos);
- if (result == null)
- {
-
-
- }
-
- var listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
- if (listBoxItem == null)
- {
-
-
- }
- #region 计算虚影位置
-
- double xPos = 0;
- double yPos = 0;
-
- if (!isDragingEnter)
- {
-
- ImgPicture.Width = tempItem.ItemSize.Width;
- ImgPicture.Height = tempItem.ItemSize.Height;
- ImgPicture.Source = tempItem.Image;
- xPos = e.GetPosition(ListPageEdit).X - item_x;
- yPos = e.GetPosition(ListPageEdit).Y - item_y;
- }
-
-
-
-
-
-
-
-
-
-
- ImgPicture.Margin = new Thickness(xPos, yPos, 0, 0);
- #endregion
- #region 计算插入标记位置
- var scroll = GetScrollHost(ListPageEdit);
- if (listBoxItem != null)
- {
-
- var p = VisualTreeHelper.GetOffset(listBoxItem);
- LineInset.Visibility = Visibility.Visible;
- var panel = GetWrapPanel(ListPageEdit);
-
-
- var item = listBoxItem.DesiredSize.Width;
- int count = (int)(panel.ViewportWidth / item);
- var gap = (panel.ViewportWidth - count * item) / (count + 1) * 1.0;
- LineInset.X2 = LineInset.X1 = p.X + gap / 2 + listBoxItem.DesiredSize.Width;
- if (pos.X < p.X + gap / 2 + listBoxItem.ActualWidth / 2)
- {
- isFrontHalf = true;
- LineInset.X2 = LineInset.X1 = p.X - gap / 2;
- InsertIndex = ListPageEdit.Items.IndexOf(listBoxItem);
- }
- else
- {
- isFrontHalf = false;
- InsertIndex = ListPageEdit.Items.IndexOf(listBoxItem) + 1;
- }
-
- LineInset.Y1 = p.Y;
- if (LineInset.Y1 < 0)
- {
- LineInset.Y1 = 0;
- }
-
- LineInset.Y2 = p.Y + listBoxItem.ActualHeight;
- if (LineInset.Y2 < 0)
- {
- LineInset.Y2 = 0;
- }
- }
- #endregion
-
- if (pos.Y <= 30 || pos.Y >= ListPageEdit.ActualHeight - 10)
- {
- LineInset.Visibility = Visibility.Collapsed;
- needScroll = false;
- }
- if (pos.X <= 40 || pos.X >= scroll.ViewportWidth - 50)
- {
- LineInset.Visibility = Visibility.Collapsed;
- needScroll = false;
- }
- #region 靠近上下边界时,自动滚动,离边界越近,滚动速度越快
- speed = 0;
- if (pos.Y >= ListPageEdit.ActualHeight - 30)
- {
- speed = 30 - (int)(ListPageEdit.ActualHeight - pos.Y);
- needScroll = true;
- }
- else if (pos.Y <= 30)
- {
- speed = (int)(pos.Y - 30);
- needScroll = true;
- }
- else
- needScroll = false;
- var v = scroll.VerticalOffset;
- scroll.ScrollToVerticalOffset(v + speed);
- #endregion
- }
- catch
- {
- }
- }
- private void ListBoxItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
-
-
- }
- private void ListBoxItem_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
- {
- if(e.ChangedButton== MouseButton.Left)
- {
-
- var item = sender as ListBoxItem;
- if (item != null)
- {
- var index = ListPageEdit.ItemContainerGenerator.IndexFromContainer(item);
-
- viewModel.BackToPDFViewer(index);
- }
- }
- }
- private void PageEdit_SizeChanged(object sender, SizeChangedEventArgs e)
- {
-
- if (GridBOTAHeader.Visibility == Visibility.Visible)
- {
- ItemSuitAcutalWidth(e.NewSize.Width);
- }
- }
- private void ItemSuitAcutalWidth(double width)
- {
-
- if ((bool)TbnTwoLine.IsChecked)
- {
- var itemwidth = (width - 80) / 2;
- var itemHeight = 294 * itemwidth / 208.0;
- viewModel.ChangeItemSize(new Size(itemwidth, itemHeight));
- }
- else
- {
- var itemwidth = 0.6 * width;
- var itemheight = 294 * itemwidth / 208.0;
- viewModel.ChangeItemSize(new Size(itemwidth,itemheight));
- }
- }
- private void TbnTwoLine_Click(object sender, RoutedEventArgs e)
- {
- ItemSuitAcutalWidth(this.ActualWidth);
- }
- }
- }
|