Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ private void HandleTapped(double x, double y)
SelectionLabel.Text = "Selected: " + string.Join(" <- ", elements!.Select(x => x.GetType().Name));
var e = elements!.FirstOrDefault() as Microsoft.Maui.Controls.View;

e?.BackgroundColor = new Microsoft.Maui.Graphics.Color(255, 0, 0);
if (e != null)
e.BackgroundColor = new Microsoft.Maui.Graphics.Color(255, 0, 0);
}

// IWindowOverlayElement/IDrawable is implemented to show the rectangle selection lasso
Expand Down
8 changes: 4 additions & 4 deletions src/Controls/src/Build.Tasks/Controls.Build.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
<ItemGroup>
<PackageReference Include="Mono.Cecil" Version="0.11.5" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="System.CodeDom" Version="7.0.0" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Build" Version="15.9.20" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.9.20" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.9.20" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.9.20" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build" Version="15.9.30" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.9.30" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.9.30" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.9.30" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Controls/src/Core/BindableLayout/BindableLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ static void SetBindableLayoutController(BindableObject b, BindableLayoutControll

static void OnControllerChanged(BindableObject b, BindableLayoutController oldC, BindableLayoutController newC)
{
oldC?.ItemsSource = null;
if (oldC != null)
oldC.ItemsSource = null;

if (newC == null)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Controls/src/Core/ImageElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ async static void CancelOldValue(ImageSource oldvalue)
static void ImageSourceChanged(BindableObject bindable, ImageSource newSource)
{
var imageElement = (VisualElement)bindable;
newSource?.Parent = imageElement;
if (newSource != null)
newSource.Parent = imageElement;
imageElement?.InvalidateMeasureInternal(InvalidationTrigger.MeasureChanged);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Controls/src/Core/Interactivity/TriggerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ internal virtual void OnSeal()
((SealedList<TriggerAction>)ExitActions).IsReadOnly = true;
if (Setters != null)
((SealedList<Setter>)Setters).IsReadOnly = true;
Condition?.IsSealed = true;
if (Condition != null)
Condition.IsSealed = true;
}

void OnConditionChanged(BindableObject bindable, bool oldValue, bool newValue)
Expand Down
4 changes: 3 additions & 1 deletion src/Controls/src/Core/Internals/EffectUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public static void RegisterEffectControlProvider(IEffectControlProvider self, IE
controller.EffectControlProvider = null;

controller = newElement;
controller?.EffectControlProvider = self;

if (controller != null)
controller.EffectControlProvider = self;
}

/// <include file="../../../docs/Microsoft.Maui.Controls.Internals/EffectUtilities.xml" path="//Member[@MemberName='UnregisterEffectControlProvider']/Docs/*" />
Expand Down
6 changes: 4 additions & 2 deletions src/Controls/src/Core/ObservableWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,13 @@ public TRestrict this[int index]
set
{
int innerIndex = ToInnerIndex(index);
value?.Owned = true;
if (value != null)
value.Owned = true;
TTrack old = _list[innerIndex];
_list[innerIndex] = value;

old?.Owned = false;
if (old != null)
old.Owned = false;
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/Controls/src/Core/SetterSpecificityList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ public void SetValue(SetterSpecificity specificity, object value)
if (_first is null || _first.Value.Key == specificity)
{
_first = new KeyValuePair<SetterSpecificity, object>(specificity, value);
_values?[specificity] = value;
if (_values != null)
_values[specificity] = value;
return;
}

if (_second is null || _second.Value.Key == specificity)
{
_second = new KeyValuePair<SetterSpecificity, object>(specificity, value);
_values?[specificity] = value;
if (_values != null)
_values[specificity] = value;
return;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Controls/src/Core/StyleSheets/Selector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ static void SetCurrentSelector(ref Selector root, ref Selector workingRoot, ref
op.Left = workingRoot;
op.Right = sel;
workingRoot = op;
workingRootParent?.Right = workingRoot;
if (workingRootParent != null)
workingRootParent.Right = workingRoot;

if (updateRoot)
root = workingRoot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ internal void Add(long timestamp, bool accelerating)
added.IsAccelerating = accelerating;
added.Next = null;

newest?.Next = added;
if (newest != null)
newest.Next = added;

newest = added;

Expand Down
18 changes: 12 additions & 6 deletions src/Graphics/src/Graphics.Skia/SkiaCanvasState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,24 @@ public void SetBlur(float radius)
_blurRadius = radius;
_blurFilter = SKMaskFilter.CreateBlur(SKBlurStyle.Normal, _blurRadius);

_fillPaint?.MaskFilter = _blurFilter;
_strokePaint?.MaskFilter = _blurFilter;
_fontPaint?.MaskFilter = _blurFilter;
if (_fillPaint != null)
_fillPaint.MaskFilter = _blurFilter;
if (_strokePaint != null)
_strokePaint.MaskFilter = _blurFilter;
if (_fontPaint != null)
_fontPaint.MaskFilter = _blurFilter;
}
else
{
_isBlurred = false;
_blurRadius = 0;

_fillPaint?.MaskFilter = null;
_strokePaint?.MaskFilter = null;
_fontPaint?.MaskFilter = null;
if (_fillPaint != null)
_fillPaint.MaskFilter = null;
if (_strokePaint != null)
_strokePaint.MaskFilter = null;
if (_fontPaint != null)
_fontPaint.MaskFilter = null;
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/SingleProject/Resizetizer/src/Resizetizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="15.9.20" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.9.20" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.9.20" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.9.20" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build" Version="15.9.30" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.9.30" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.9.30" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.9.30" PrivateAssets="all" />
</ItemGroup>

<Import Project="ResizetizerPackages.projitems" />
Expand Down
Loading