if (_applicationInitEventCallbackDelegate != null)
{
- this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
+ ApplicationSignal initSignal = this.InitSignal();
+ initSignal?.Disconnect(_applicationInitEventCallbackDelegate);
+ initSignal?.Dispose();
}
if (_applicationTerminateEventCallbackDelegate != null)
{
- this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
+ ApplicationSignal terminateSignal = this.TerminateSignal();
+ terminateSignal?.Disconnect(_applicationTerminateEventCallbackDelegate);
+ terminateSignal?.Dispose();
}
if (_applicationPauseEventCallbackDelegate != null)
{
- this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
+ ApplicationSignal pauseSignal = this.PauseSignal();
+ pauseSignal?.Disconnect(_applicationPauseEventCallbackDelegate);
+ pauseSignal?.Dispose();
}
if (_applicationResumeEventCallbackDelegate != null)
{
- this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
+ ApplicationSignal resumeSignal = this.ResumeSignal();
+ resumeSignal?.Disconnect(_applicationResumeEventCallbackDelegate);
+ resumeSignal?.Dispose();
}
if (_applicationResetEventCallbackDelegate != null)
{
- this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
+ ApplicationSignal resetSignal = this.ResetSignal();
+ resetSignal?.Disconnect(_applicationResetEventCallbackDelegate);
+ resetSignal?.Dispose();
}
if (_applicationLanguageChangedEventCallbackDelegate != null)
{
- this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
+ ApplicationSignal languageChangedSignal = this.LanguageChangedSignal();
+ languageChangedSignal?.Disconnect(_applicationLanguageChangedEventCallbackDelegate);
+ languageChangedSignal?.Dispose();
}
if (_applicationRegionChangedEventCallbackDelegate != null)
{
- this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
+ ApplicationSignal regionChangedSignal = this.RegionChangedSignal();
+ regionChangedSignal?.Disconnect(_applicationRegionChangedEventCallbackDelegate);
+ regionChangedSignal?.Dispose();
}
if (_applicationBatteryLowEventCallbackDelegate != null)
{
- this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
+ LowBatterySignalType batteryLowSignal = this.BatteryLowSignal();
+ batteryLowSignal?.Disconnect(_applicationBatteryLowEventCallbackDelegate);
+ batteryLowSignal?.Dispose();
}
if (_applicationMemoryLowEventCallbackDelegate != null)
{
- this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
+ LowMemorySignalType memoryLowSignal = this.MemoryLowSignal();
+ memoryLowSignal?.Disconnect(_applicationMemoryLowEventCallbackDelegate);
+ memoryLowSignal?.Dispose();
}
if (_applicationAppControlEventCallbackDelegate != null)
{
- this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
+ ApplicationControlSignal appControlSignal = this.AppControlSignal();
+ appControlSignal?.Disconnect(_applicationAppControlEventCallbackDelegate);
+ appControlSignal?.Dispose();
}
base.Dispose(type);
{
if (_applicationInitEventHandler != null)
{
- this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
+ ApplicationSignal initSignal = this.InitSignal();
+ initSignal?.Disconnect(_applicationInitEventCallbackDelegate);
+ initSignal?.Dispose();
}
_applicationInitEventHandler -= value;
{
if (_applicationTerminateEventHandler != null)
{
- this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
+ ApplicationSignal terminateSignal = this.TerminateSignal();
+ terminateSignal?.Disconnect(_applicationTerminateEventCallbackDelegate);
+ terminateSignal?.Dispose();
}
_applicationTerminateEventHandler -= value;
{
if (_applicationPauseEventHandler != null)
{
- this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
+ ApplicationSignal pauseSignal = this.PauseSignal();
+ pauseSignal?.Disconnect(_applicationPauseEventCallbackDelegate);
+ pauseSignal?.Dispose();
}
_applicationPauseEventHandler -= value;
{
if (_applicationResumeEventHandler != null)
{
- this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
+ ApplicationSignal resumeSignal = this.ResumeSignal();
+ resumeSignal?.Disconnect(_applicationResumeEventCallbackDelegate);
+ resumeSignal?.Dispose();
}
_applicationResumeEventHandler -= value;
{
if (_applicationResetEventHandler != null)
{
- this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
+ ApplicationSignal resetSignal = this.ResetSignal();
+ resetSignal?.Disconnect(_applicationResetEventCallbackDelegate);
+ resetSignal?.Dispose();
}
_applicationResetEventHandler -= value;
{
if (_applicationLanguageChangedEventHandler != null)
{
- this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
+ ApplicationSignal languageChangedSignal = this.LanguageChangedSignal();
+ languageChangedSignal?.Disconnect(_applicationLanguageChangedEventCallbackDelegate);
+ languageChangedSignal?.Dispose();
}
_applicationLanguageChangedEventHandler -= value;
{
if (_applicationRegionChangedEventHandler != null)
{
- this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
+ ApplicationSignal regionChangedSignal = this.RegionChangedSignal();
+ regionChangedSignal?.Disconnect(_applicationRegionChangedEventCallbackDelegate);
+ regionChangedSignal?.Dispose();
}
_applicationRegionChangedEventHandler -= value;
{
if (_applicationBatteryLowEventHandler != null)
{
- this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
+ LowBatterySignalType BatteryLowSignal = this.BatteryLowSignal();
+ BatteryLowSignal?.Disconnect(_applicationBatteryLowEventCallbackDelegate);
+ BatteryLowSignal?.Dispose();
}
_applicationBatteryLowEventHandler -= value;
{
if (_applicationMemoryLowEventHandler != null)
{
- this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
+ LowMemorySignalType memoryLowSignal = this.MemoryLowSignal();
+ memoryLowSignal?.Disconnect(_applicationMemoryLowEventCallbackDelegate);
+ memoryLowSignal?.Dispose();
}
_applicationMemoryLowEventHandler -= value;
{
if (_applicationAppControlEventHandler != null)
{
- this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
+ ApplicationControlSignal appControlSignal = this.AppControlSignal();
+ appControlSignal?.Disconnect(_applicationAppControlEventCallbackDelegate);
+ appControlSignal?.Dispose();
}
_applicationAppControlEventHandler -= value;
if (_resourceReadyEventHandler == null)
{
_resourceReadyEventCallback = OnResourceReady;
- ResourceReadySignal(this).Connect(_resourceReadyEventCallback);
+ ViewResourceReadySignal resourceReadySignal = ResourceReadySignal(this);
+ resourceReadySignal?.Connect(_resourceReadyEventCallback);
+ resourceReadySignal?.Dispose();
}
_resourceReadyEventHandler += value;
{
_resourceReadyEventHandler -= value;
- if (_resourceReadyEventHandler == null && ResourceReadySignal(this).Empty() == false)
+ ViewResourceReadySignal resourceReadySignal = ResourceReadySignal(this);
+ if (_resourceReadyEventHandler == null && resourceReadySignal?.Empty() == false)
{
- ResourceReadySignal(this).Disconnect(_resourceReadyEventCallback);
+ resourceReadySignal?.Disconnect(_resourceReadyEventCallback);
}
+ resourceReadySignal?.Dispose();
}
}
if (_resourceLoadedEventHandler == null)
{
_resourceLoadedCallback = OnResourceLoaded;
- this.ResourceReadySignal(this).Connect(_resourceLoadedCallback);
+ ViewResourceReadySignal resourceReadySignal = this.ResourceReadySignal(this);
+ resourceReadySignal?.Connect(_resourceLoadedCallback);
+ resourceReadySignal?.Dispose();
}
_resourceLoadedEventHandler += value;
remove
{
_resourceLoadedEventHandler -= value;
-
- if (_resourceLoadedEventHandler == null && this.ResourceReadySignal(this).Empty() == false)
+ ViewResourceReadySignal resourceReadySignal = this.ResourceReadySignal(this);
+ if (_resourceLoadedEventHandler == null && resourceReadySignal?.Empty() == false)
{
- this.ResourceReadySignal(this).Disconnect(_resourceLoadedCallback);
+ resourceReadySignal?.Disconnect(_resourceLoadedCallback);
}
+ resourceReadySignal?.Dispose();
}
}
{
if (_border == null)
{
- PropertyMap temp = new PropertyMap();
- GetProperty(ImageView.Property.IMAGE).Get(temp);
- return temp;
+ PropertyMap returnValue = new PropertyMap();
+ PropertyValue image = GetProperty(ImageView.Property.IMAGE);
+ image?.Get(returnValue);
+ image?.Dispose();
+ return returnValue;
}
else
{
{
if (_border == null)
{
- SetProperty(ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(value));
+ PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
+ SetProperty(ImageView.Property.IMAGE, setValue);
NotifyPropertyChanged();
+ setValue?.Dispose();
}
}
}
/// <since_tizen> 5 </since_tizen>
public void Reload()
{
- this.DoAction(ImageView.Property.IMAGE, Property.ActionReload, new PropertyValue(0));
+ PropertyValue attributes = new PropertyValue(0);
+ this.DoAction(ImageView.Property.IMAGE, Property.ActionReload, attributes);
+ attributes?.Dispose();
}
/// <summary>
/// <since_tizen> 5 </since_tizen>
public void Play()
{
- this.DoAction(ImageView.Property.IMAGE, Property.ActionPlay, new PropertyValue(0));
+ PropertyValue attributes = new PropertyValue(0);
+ this.DoAction(ImageView.Property.IMAGE, Property.ActionPlay, attributes);
+ attributes?.Dispose();
}
/// <summary>
/// <since_tizen> 5 </since_tizen>
public void Pause()
{
- this.DoAction(ImageView.Property.IMAGE, Property.ActionPause, new PropertyValue(0));
+ PropertyValue attributes = new PropertyValue(0);
+ this.DoAction(ImageView.Property.IMAGE, Property.ActionPause, attributes);
+ attributes?.Dispose();
}
/// <summary>
/// <since_tizen> 5 </since_tizen>
public void Stop()
{
- this.DoAction(ImageView.Property.IMAGE, Property.ActionStop, new PropertyValue(0));
+ PropertyValue attributes = new PropertyValue(0);
+ this.DoAction(ImageView.Property.IMAGE, Property.ActionStop, attributes);
+ attributes?.Dispose();
}
/// <summary>
{
string ret = "";
PropertyMap imageMap = new PropertyMap();
- Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
- imageMap?.Find(ImageVisualProperty.AlphaMaskURL)?.Get(out ret);
-
+ PropertyValue image = Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue maskUrl = imageMap?.Find(ImageVisualProperty.AlphaMaskURL);
+ maskUrl?.Get(out ret);
_alphaMaskUrl = ret;
+
+ imageMap?.Dispose();
+ image?.Dispose();
+ maskUrl?.Dispose();
+
return ret;
}
set
}
_alphaMaskUrl = value;
- UpdateImage(ImageVisualProperty.AlphaMaskURL, new PropertyValue(value));
+
+ PropertyValue setValue = new PropertyValue(value);
+ UpdateImage(ImageVisualProperty.AlphaMaskURL, setValue);
+ setValue?.Dispose();
}
}
{
bool ret = false;
PropertyMap imageMap = new PropertyMap();
- Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
- imageMap?.Find(ImageVisualProperty.CropToMask)?.Get(out ret);
+ PropertyValue image = Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue cropUrl = imageMap?.Find(ImageVisualProperty.CropToMask);
+ cropUrl?.Get(out ret);
+
+ imageMap?.Dispose();
+ image?.Dispose();
+ cropUrl?.Dispose();
return ret;
}
set
{
- UpdateImage(ImageVisualProperty.CropToMask, new PropertyValue(value));
+ PropertyValue setValue = new PropertyValue(value);
+ UpdateImage(ImageVisualProperty.CropToMask, setValue);
+ setValue.Dispose();
}
}
{
int ret = (int)VisualFittingModeType.Fill;
PropertyMap imageMap = new PropertyMap();
- Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
- imageMap?.Find(Visual.Property.VisualFittingMode)?.Get(out ret);
+ PropertyValue image = Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue fittingMode = imageMap?.Find(Visual.Property.VisualFittingMode);
+ fittingMode?.Get(out ret);
+
+ imageMap?.Dispose();
+ image?.Dispose();
+ fittingMode?.Dispose();
+
return ConvertVisualFittingModetoFittingMode((VisualFittingModeType)ret);
}
set
{
VisualFittingModeType ret = CovertFittingModetoVisualFittingMode(value);
- UpdateImage(Visual.Property.VisualFittingMode, new PropertyValue((int)ret));
+ PropertyValue setValue = new PropertyValue((int)ret);
+ UpdateImage(Visual.Property.VisualFittingMode, setValue);
+ setValue?.Dispose();
}
}
get
{
PropertyMap imageMap = new PropertyMap();
- Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
- imageMap?.Find(ImageVisualProperty.DesiredWidth)?.Get(out _desired_width);
+ PropertyValue image = Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue desireWidth = imageMap?.Find(ImageVisualProperty.DesiredWidth);
+ desireWidth?.Get(out _desired_width);
+
+ imageMap?.Dispose();
+ image?.Dispose();
+ desireWidth?.Dispose();
return _desired_width;
}
get
{
PropertyMap imageMap = new PropertyMap();
- Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
- imageMap?.Find(ImageVisualProperty.DesiredHeight)?.Get(out _desired_height);
+ PropertyValue image = Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue desireheight = imageMap?.Find(ImageVisualProperty.DesiredHeight);
+ desireheight?.Get(out _desired_height);
+
+ imageMap?.Dispose();
+ image?.Dispose();
+ desireheight?.Dispose();
return _desired_height;
}
{
int ret = (int)ReleasePolicyType.Detached;
PropertyMap imageMap = new PropertyMap();
- Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
- imageMap?.Find(ImageVisualProperty.ReleasePolicy)?.Get(out ret);
+ PropertyValue image = Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue releasePoli = imageMap?.Find(ImageVisualProperty.ReleasePolicy);
+ releasePoli?.Get(out ret);
+
+ imageMap?.Dispose();
+ image?.Dispose();
+ releasePoli?.Dispose();
+
return (ReleasePolicyType)ret;
}
set
{
- UpdateImage(ImageVisualProperty.ReleasePolicy, new PropertyValue((int)value));
+ PropertyValue setValue = new PropertyValue((int)value);
+ UpdateImage(ImageVisualProperty.ReleasePolicy, setValue);
+ setValue?.Dispose();
}
}
{
int ret = (int)WrapModeType.Default;
PropertyMap imageMap = new PropertyMap();
- Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
- imageMap?.Find(ImageVisualProperty.WrapModeU)?.Get(out ret);
+ PropertyValue image = Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue warpModeU = imageMap?.Find(ImageVisualProperty.WrapModeU);
+ warpModeU?.Get(out ret);
+
+ imageMap?.Dispose();
+ image?.Dispose();
+ warpModeU?.Dispose();
return (WrapModeType)ret;
}
set
{
- UpdateImage(ImageVisualProperty.WrapModeU, new PropertyValue((int)value));
+ PropertyValue setValue = new PropertyValue((int)value);
+ UpdateImage(ImageVisualProperty.WrapModeU, setValue);
+ setValue?.Dispose();
}
}
{
int ret = (int)WrapModeType.Default;
PropertyMap imageMap = new PropertyMap();
- Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
- imageMap?.Find(ImageVisualProperty.WrapModeV)?.Get(out ret);
+ PropertyValue image = Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue wrapModeV = imageMap?.Find(ImageVisualProperty.WrapModeV);
+ wrapModeV?.Get(out ret);
+
+ imageMap?.Dispose();
+ image?.Dispose();
+ wrapModeV?.Dispose();
return (WrapModeType)ret;
}
set
{
- UpdateImage(ImageVisualProperty.WrapModeV, new PropertyValue((int)value));
+ PropertyValue setValue = new PropertyValue((int)value);
+ UpdateImage(ImageVisualProperty.WrapModeV, setValue);
+ setValue?.Dispose();
}
}
private void UpdateImageMap(PropertyMap fromMap)
{
PropertyMap imageMap = new PropertyMap();
- Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
- imageMap.Merge(fromMap);
- SetProperty(ImageView.Property.IMAGE, new PropertyValue(imageMap));
+ PropertyValue image = Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ imageMap?.Merge(fromMap);
+ PropertyValue setValue = new PropertyValue(imageMap);
+ SetProperty(ImageView.Property.IMAGE, setValue);
+
+ imageMap?.Dispose();
+ image?.Dispose();
+ setValue?.Dispose();
}
private void UpdateImage(int key, PropertyValue value)
{
- PropertyMap temp = new PropertyMap();
+ PropertyMap imageMap = new PropertyMap();
if (_alphaMaskUrl != null)
{
- temp.Insert(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl));
+ PropertyValue alphaMaskUrl = new PropertyValue(_alphaMaskUrl);
+ imageMap?.Insert(ImageVisualProperty.AlphaMaskURL, alphaMaskUrl);
+ alphaMaskUrl?.Dispose();
}
if (_resourceUrl == "")
{
- temp.Insert(ImageVisualProperty.URL, new PropertyValue(_resourceUrl));
- SetProperty(ImageView.Property.IMAGE, new PropertyValue(temp));
+ PropertyValue resourceUrl = new PropertyValue(_resourceUrl);
+ imageMap?.Insert(ImageVisualProperty.URL, resourceUrl);
+ PropertyValue setValue = new PropertyValue(imageMap);
+ SetProperty(ImageView.Property.IMAGE, setValue);
+ resourceUrl?.Dispose();
+ setValue?.Dispose();
return;
}
if (_border == null)
{
- temp.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
+ PropertyValue image = new PropertyValue((int)Visual.Type.Image);
+ imageMap?.Insert(Visual.Property.Type, image);
+ image?.Dispose();
}
else
{
- temp.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
- temp.Insert(NpatchImageVisualProperty.Border, new PropertyValue(_border));
+ PropertyValue nPatch = new PropertyValue((int)Visual.Type.NPatch);
+ imageMap?.Insert(Visual.Property.Type, nPatch);
+ nPatch?.Dispose();
+ PropertyValue border = new PropertyValue(_border);
+ imageMap?.Insert(NpatchImageVisualProperty.Border, border);
+ border?.Dispose();
}
- temp.Insert(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue(_synchronosLoading));
+ PropertyValue synchronosLoading = new PropertyValue(_synchronosLoading);
+ imageMap?.Insert(NpatchImageVisualProperty.SynchronousLoading, synchronosLoading);
+ synchronosLoading?.Dispose();
if (backgroundExtraData != null && backgroundExtraData.CornerRadius > 0)
{
- temp.Insert(Visual.Property.CornerRadius, new PropertyValue(backgroundExtraData.CornerRadius));
+ PropertyValue cornerRadius = new PropertyValue(backgroundExtraData.CornerRadius);
+ imageMap?.Insert(Visual.Property.CornerRadius, cornerRadius);
+ cornerRadius?.Dispose();
}
if (value != null)
{
- temp.Insert(key, value);
+ imageMap?.Insert(key, value);
}
// Do Fitting Buffer when desired dimension is set
{
if (_resourceUrl != null)
{
- Size2D imageSize = ImageLoading.GetOriginalImageSize(_resourceUrl);
-
- int adjustedDesiredWidth, adjustedDesiredHeight;
- float aspectOfDesiredSize = (float)_desired_height / (float)_desired_width;
- float aspectOfImageSize = (float)imageSize.Height / (float)imageSize.Width;
- if( aspectOfImageSize > aspectOfDesiredSize)
- {
- adjustedDesiredWidth = _desired_width;
- adjustedDesiredHeight = imageSize.Height * _desired_width / imageSize.Width;
- }
- else
- {
- adjustedDesiredWidth = imageSize.Width * _desired_height/ imageSize.Height;
- adjustedDesiredHeight = _desired_height;
- }
- temp.Insert(ImageVisualProperty.DesiredWidth, new PropertyValue(adjustedDesiredWidth));
- temp.Insert(ImageVisualProperty.DesiredHeight, new PropertyValue(adjustedDesiredHeight));
- temp.Insert(ImageVisualProperty.FittingMode, new PropertyValue((int)FittingModeType.ScaleToFill));
+ Size2D originalImageSize = ImageLoading.GetOriginalImageSize(_resourceUrl);
+ Size2D imageSize = originalImageSize;
+ originalImageSize?.Dispose();
+
+ int adjustedDesiredWidth, adjustedDesiredHeight;
+ float aspectOfDesiredSize = (float)_desired_height / (float)_desired_width;
+ float aspectOfImageSize = (float)imageSize.Height / (float)imageSize.Width;
+ if( aspectOfImageSize > aspectOfDesiredSize)
+ {
+ adjustedDesiredWidth = _desired_width;
+ adjustedDesiredHeight = imageSize.Height * _desired_width / imageSize.Width;
+ }
+ else
+ {
+ adjustedDesiredWidth = imageSize.Width * _desired_height/ imageSize.Height;
+ adjustedDesiredHeight = _desired_height;
+ }
+
+ PropertyValue returnWidth = new PropertyValue(adjustedDesiredWidth);
+ imageMap?.Insert(ImageVisualProperty.DesiredWidth, returnWidth);
+ returnWidth?.Dispose();
+ PropertyValue returnHeight = new PropertyValue(adjustedDesiredHeight);
+ imageMap?.Insert(ImageVisualProperty.DesiredHeight, returnHeight);
+ returnHeight?.Dispose();
+ PropertyValue scaleToFit = new PropertyValue((int)FittingModeType.ScaleToFill);
+ imageMap?.Insert(ImageVisualProperty.FittingMode, scaleToFit);
+ scaleToFit?.Dispose();
}
}
- UpdateImageMap(temp);
+ UpdateImageMap(imageMap);
- temp.Dispose();
- temp = null;
+ imageMap?.Dispose();
+ imageMap = null;
}