Skip to content

Instantly share code, notes, and snippets.

View GioviQ's full-sized avatar
:octocat:
Blazor dev

GioviQ

:octocat:
Blazor dev
View GitHub Profile
<Style TargetType="TextBox" x:Key="MaterialDesignFloatingHintTextBoxWithFocus" BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsVisible}" Value="True">
<Setter Property="FocusManager.FocusedElement" Value="{Binding RelativeSource={RelativeSource Self}}"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style TargetType="PasswordBox" x:Key="PasswordBoxWithFocus" BasedOn="{StaticResource MaterialDesignPasswordBox}">
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsVisible}" Value="True">
@GioviQ
GioviQ / GuidUtil
Created January 26, 2021 13:57
GuidUtil with extension to compress Guid string representation useful for Guid as url parameter
public static class GuidUtil
{
public static string ToCompressedString(this Guid guid)
{
return Convert.ToBase64String(guid.ToByteArray())
.Substring(0, 22)
.Replace('+', '-')
.Replace('/', '_');
}
@GioviQ
GioviQ / ContentButton.cs
Created March 9, 2020 08:04
ContentButton for Xamarin Forms
using System.Windows.Input;
using Xamarin.Forms;
namespace Xamarin.Controls
{
public class ContentButton : ContentView
{
private readonly TapGestureRecognizer _tapGestureRecognizer;
public ContentButton()
@GioviQ
GioviQ / ko.components.register.js
Created February 14, 2018 14:08
toggle-switch knockout component
ko.components.register('toggle-switch', {
viewModel: function (params) {
this.checked = params.checked;
},
template: '<label class="switch">' +
'<input type="checkbox" data-bind="checked: checked" />' +
'<span class="slider round"></span></label>'
});
@GioviQ
GioviQ / ko.bindingHandlers.datetimepicker.js
Last active February 13, 2018 20:01
knockout.js datetimepicker bindingHandler
ko.bindingHandlers.datetimepicker = {
init: function (element, valueAccessor, allBindingsAccessor) {
/*! version : 4.17.45
=========================================================
bootstrap-datetimejs
https://github.com/Eonasdan/bootstrap-datetimepicker
=========================================================
*/
$(element).datetimepicker({
icons: {