Skip to content

Commit

Permalink
BugFix
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegLobakov committed Aug 14, 2018
1 parent 586dba6 commit 10428e5
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="d6b0a390-f9c0-4482-81e5-ba609063ca62" Publisher="CN=Lobakov Oleg" Version="1.1.17.0" />
<Identity Name="d6b0a390-f9c0-4482-81e5-ba609063ca62" Publisher="CN=Lobakov Oleg" Version="1.1.18.0" />
<mp:PhoneIdentity PhoneProductId="d6b0a390-f9c0-4482-81e5-ba609063ca62" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>WarehouseControl.UWP</DisplayName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace WarehouseControlSystem.Model
{
public class SubSchemeElement
{
public string Text { get; set; }
public int Left { get; set; }
public int Top { get; set; }
public int Height { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ namespace WarehouseControlSystem.View.Content
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class InnerSubSchemeView : ContentView
{
public static readonly BindableProperty SchemeTypeProperty = BindableProperty.Create(nameof(SchemeType), typeof(int), typeof(InnerSubSchemeView), 0, BindingMode.Default, null, Changed);
public int SchemeType
{
get { return (int)GetValue(SchemeTypeProperty); }
set { SetValue(SchemeTypeProperty, value); }
}

public static readonly BindableProperty PlanHeightProperty = BindableProperty.Create(nameof(PlanHeight), typeof(int), typeof(InnerSubSchemeView), 0, BindingMode.Default, null, Changed);
public int PlanHeight
{
Expand Down Expand Up @@ -135,19 +142,36 @@ private void AddToScheme(SubSchemeElement element)
Color color1 = Color.FromHex(element.HexColor);
if (color1 == (Color)Application.Current.Resources["SchemeBlockWhiteColor"])
{
color1 = Color.Black;
color1 = Color.WhiteSmoke;
}

int left = Math.Max(0, Math.Min(PlanWidth, element.Left));
int right = Math.Min(PlanWidth, element.Left + element.Width);
int top = Math.Max(0, Math.Min(PlanHeight, element.Top));
int bottom = Math.Min(PlanHeight, element.Top + element.Height);

maingrid.Children.Add(
new BoxView()
{
BackgroundColor = color1
}, left, right, top, bottom);
if (SchemeType == 0)
{
maingrid.Children.Add(
new BoxView()
{
Opacity = 0.5,
BackgroundColor = color1
}, left, right, top, bottom);
}
else
{
maingrid.Children.Add(
new Label()
{
FontSize = Device.GetNamedSize(NamedSize.Small,typeof(Label)),
Text = element.Text,
Opacity = 0.5,
HorizontalTextAlignment = TextAlignment.Center,
VerticalTextAlignment = TextAlignment.Center,
BackgroundColor = color1
}, left, right, top, bottom);
}
}

private void ShowSelection(SubSchemeElement element)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
SubSchemeElements="{Binding SubSchemeElements}"
IsVisible="{Binding ZonesIsLoaded}"
SubSchemeBackgroundColor="{Binding Color}"
UpdateScheme="{Binding ZonesIsLoaded}"/>
UpdateScheme="{Binding ZonesIsLoaded}" SchemeType="1"/>
</StackLayout>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,9 @@ public bool IsIndicatorsVisible
get { return isindicatorsvisible; }
set
{
if (isindicatorsvisible != value)
{
isindicatorsvisible = value;
IsNotIndicatorsVisible = !value;
OnPropertyChanged(nameof(IsIndicatorsVisible));
}
isindicatorsvisible = value;
IsNotIndicatorsVisible = !value;
OnPropertyChanged(nameof(IsIndicatorsVisible));
}
} bool isindicatorsvisible;
public bool IsNotIndicatorsVisible
Expand Down Expand Up @@ -485,6 +482,7 @@ private void AddSubSchemeElements(List<Zone> zones)
{
SubSchemeElement sse = new SubSchemeElement
{
Text = zone.Description,
Left = zone.Left,
Top = zone.Top,
Height = zone.Height,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,14 @@ public bool IsIndicatorsVisible
get { return isindicatorsvisible; }
set
{
if (isindicatorsvisible != value)
isindicatorsvisible = value;
foreach (LocationViewModel lvm in LocationViewModels)
{
isindicatorsvisible = value;
foreach (LocationViewModel lvm in LocationViewModels)
{
lvm.IsIndicatorsVisible = value;
}
OnPropertyChanged(nameof(IsIndicatorsVisible));
lvm.IsIndicatorsVisible = value;
}
OnPropertyChanged(nameof(IsIndicatorsVisible));
}
}
bool isindicatorsvisible;
} bool isindicatorsvisible;

public LocationsPlanViewModel(INavigation navigation) : base(navigation)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,9 @@ public bool IsIndicatorsVisible
get { return isindicatorsvisible; }
set
{
if (isindicatorsvisible != value)
{
isindicatorsvisible = value;
IsNotIndicatorsVisible = !value;
OnPropertyChanged(nameof(IsIndicatorsVisible));
}
isindicatorsvisible = value;
IsNotIndicatorsVisible = !value;
OnPropertyChanged(nameof(IsIndicatorsVisible));
}
} bool isindicatorsvisible;
public bool IsNotIndicatorsVisible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,14 @@ public bool IsIndicatorsVisible
get { return isindicatorsvisible; }
set
{
if (isindicatorsvisible != value)
isindicatorsvisible = value;
foreach (ZoneViewModel zvm in ZoneViewModels)
{
isindicatorsvisible = value;
foreach (ZoneViewModel zvm in ZoneViewModels)
{
zvm.IsIndicatorsVisible = value;
}
OnPropertyChanged(nameof(IsIndicatorsVisible));
zvm.IsIndicatorsVisible = value;
}
OnPropertyChanged(nameof(IsIndicatorsVisible));
}
}
bool isindicatorsvisible;
} bool isindicatorsvisible;

public ZonesPlanViewModel(INavigation navigation, Location location) : base(navigation)
{
Expand Down

0 comments on commit 10428e5

Please sign in to comment.