我正在开发Xamarin Cross平台应用程序,我正在使用Google Cloud Messaging服务.因此,当我调用下面的方法时,我得到异常"设备没有包com.google.android.gsf".我试图在Visual Studio Android Emulator(MarshMallow Android 6.0 -API 23)和(Lollipop Android 5.1 - API 22)上运行这个项目
那么如何克服这个问题呢.提前致谢.
try {
GcmClient.CheckDevice(this);
GcmClient.CheckManifest(this);
// Register for push notifications
Log.Info("MainActivity", "Registering...");
GcmClient.Register(this, Constants.SenderID);
}
catch(Exception ex)
{
}
Run Code Online (Sandbox Code Playgroud) android-emulator google-cloud-messaging xamarin.forms visual-studio-2015
我在登录页面使用了模板驱动的表单.我想在输入元素上有一个红色边框,如果它们无效或有任何错误,borderRed但当输入为空或无效时,该类没有添加到输入元素上.
<form (ngSubmit)="f.form.valid && signin()" #f="ngForm" class="m-login__form m-form" action="">
<ng-template #alertSignin></ng-template>
<div class="form-group form-md-line-input form-md-floating-label">
<label>
Email <span class="text-danger">*</span>
</label>
<input [class.borderRed]="email.invalid" class="form-control m-input" type="text" required="required" name="email" [(ngModel)]="model.email" #email="ngModel" autocomplete="off">
</div>
<div class="form-group form-md-line-input form-md-floating-label">
<label [pTooltip]="attachementTooltipmsg" tooltipPosition="top" for="form_control_1">
Password <span class="text-danger">*</span>
</label>
<input [class.borderRed]="password.invalid" class="form-control m-input" required="" name="password" type="password" [(ngModel)]="model.password" #password="ngModel">
</div>
<div class="m-login__form-action">
<button [disabled]="loading" [ngClass]="{'m-loader m-loader--right m-loader--light': loading}" id="m_login_signin_submit" class="btn btn-focus m-btn m-btn--pill m-btn--custom m-btn--air">
Sign In
</button>
</div>
</form>
Run Code Online (Sandbox Code Playgroud) 我正在使用jquery.dataTables并将knockout js数据绑定到表.
从中删除项目后observableArray,UI不会更新.因为我将数据绑定到jquery.Datatable它可以重新初始化表; 所以我通过调用TableManaged.init();方法重新启动表,但它正在生成警告cannot reinitialise datatable.
以下是我的代码.
function PatientVM(vm) {
self.MDSPatientId = ko.observable(vm.MDSPatientId());
self.PatientNumber = ko.observable(vm.PatientNumber());
self.PrescribingDay = ko.observable(vm.PrescribingDay());
self.OneWeekItems = ko.observable(vm.OneWeekItems());
self.DeliveryDay = ko.observable(vm.DeliveryDay());
self.IsActive = ko.observable(vm.IsActive());
self.WeekColor = ko.observable(vm.WeekColor());
self.PatientName = ko.observable(vm.PatientName());
self.FullAddress = ko.observable(vm.FullAddress());
}
function Patients(vm) {
var self = this;
self.PatientList = ko.observableArray();
if (vm.PatientList() != null) {
for (i = 0; i < vm.PatientList().length; i++) {
var p = new PatientVM(vm.PatientList()[i]);
self.PatientList.push(p); …Run Code Online (Sandbox Code Playgroud)我想绑定span标签中的文本但是visible = false,并将鼠标悬停在工具提示中的图像显示范围文本上.
<td class="calign"><img src="~/Images/Approval.png" height="15" width="15" alt="" data-bind="tooltip:ApprovalText" /></td>
Run Code Online (Sandbox Code Playgroud)
工具提示无法在图像悬停时显示.